File sharing between two SuSE boxes

Please help or at least provide direction…

I want to share files between my desktop box and my laptop either by my mains-LAN or by ethernet cable and cannot find anything on the forum to point me in the right direction.

There is plenty of information to help with the installation of Apache/LAMP and the like. But is this what I need? Will I need to create logon IDs to the desktop to share files (and even the printer?).

I am at the what do I need stage rather than the how do I …? stage.

Apologies if I have posted this to the wrong form as it can be network or it could be application.

Both machines are running SUSE 11.2, KDE4.? Both have USB(s) and an Ethernet port. HP Printer (CUPS/HPLIP) via USB from desktop. Broadband connection into Desktop via cable modem and ethernet port via a Router.

Assuming they’re both connected to the router: very simple: FISH !!!

Open a terminal on both and do:
ip addr
This will return the machines’ IP addresses.

On both, start Yast - System - Runlevel and see that sshd is started/active, if not start it. Save changes and exit

On machine 1 open Konqueror. Enter


fish://YOURUSERNAME@IPADDRESS_OF_MACHINE_2

YOURUSERNAME has to exist on the machine you’re “going” to, in this case machine 2
This works the other way around from machine 2

Other possibilities: NFS, Samba

I respect knurpht - he gives good answers, but idk fish. Ssh will give you cli (terminal) access. Sshfs will give you a mount point and gui file system. Samba will also, but would be more problematic to set up, and isn’t necessary for linux-linux connections.

The elegant way:

Open Dolphin, select Network in “Places”.
Click the “Add Networkfolder”
Choose “Secure shell (ssh)”
In the next screen give the connection a name, enter the IP and a valid username for the machine you want to connect to, the folder where to “land”. Leave other settings default.
Click Save and Connect.
You will be asked for the password
Done.

Clicking the new networkconnection will open the remote machine’s folder in Dolphin.

Thank you Knurpht & spokesinger.

I’ll try this now I now know what to look for. Fish and Dolphin - sounds too good to be true!

I imagined there was a way other than Apache which seemed a bit heavy-handed for what I need.

I now have one problem in that I have the same userid for both boxes so that needs to be changed on one of them.

Cheeky bit now…
Would the second machine see the printer too, or is this a bit too much to ask? Not a problem as I could grab the file to print from the desktop via the remote link. I need to be in the same room as the printer to see the printed document anyway.

Hi
If you generate keys and copy to each machine, then no passwords
required;


ssh-keygen

Generating public/private rsa key pair.
Enter file in which to save the key (/home/<username>/.ssh/id_rsa):
Created directory '/home/<username>/.ssh'.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/<username>/.ssh/id_rsa.
Your public key has been saved in /home/<username>/.ssh/id_rsa.pub.
The key fingerprint is:
xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx <username>@<local_host>
The key's randomart image is:
+-- RSA 2048]----+
+-----------------+

Then copy the key that’s generated;


ssh-copy-id -i .ssh/id_rsa.pub <username>@<remote_host>

The authenticity of host '<remote_host> (xxx.xxx.xxx.xxx)' can't be established. RSA key fingerprint is xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx.
+-- RSA 1024]----+
+-----------------+
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '<remote_host>,xxx.xxx.xxx.xxx' (RSA) to the list of known hosts.
Password:

Now try logging into the machine, with "ssh
'<username>@<remote_host>'", and check in:

.ssh/authorized_keys

to make sure we haven't added extra keys that you weren't expecting.

Then test


ssh <remote_host>

Host key fingerprint is xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx
+-- RSA 1024]----+
+-----------------+

Last login: Wed Apr 28 20:00:18 2010 from <local_host>
<username>@<remote_host>:~$

Now when using the GUI method, no password required.


Cheers Malcolm °¿° (Linux Counter #276890)
SUSE Linux Enterprise Desktop 11 (x86_64) Kernel 2.6.27.45-0.1-default
up 14 days 2:39, 4 users, load average: 0.10, 0.11, 0.24
GPU GeForce 8600 GTS Silent - CUDA Driver Version: 195.36.15

Thanks malcolmlewis. I’ll try this at the weekend when I have both machines in the same place.

Just a note to close this off for future reference for other forum users.

I chose Knurpht’s “elegant” solution which I have used here and enhanced with my experiences…

Open a terminal on both machines and type: ip addr
This will return the machines’ IP addresses. Look for the address that immediately follows the word “inet”.

On both, start Yast - System - Runlevel and see that sshd is started/active, if not, start it by clicking on “Enable”. Save changes (OK) and exit.

Still in YaST, navigate to - Security & Users - Firewall - Allowed Services - and in the “Service to Allow” drop-down chose “Secure Shell Server”. Click on “Add” and close.
Exit YaST.

Open Dolphin, select Network in “Places”.
Click the “Add Network Folder”
Choose “Secure shell (ssh)”
In the next screen give the connection a name, enter the IP and a valid username on the machine you want to connect to, the folder where to “land”. Leave other settings default.
Click Save and Connect.
You will be asked for the password
Done.

Clicking the new networkconnection will open the remote machine’s folder in Dolphin.

I did not try the keys option as I am not sure how stable the IP addresses are.

Thank you all for your help and clear instructions. Cheers.

clatworthy wrote:
> Just a note to close this off for future reference for other forum
> users.
>
> I chose Knurpht’s “elegant” solution which I have used here and
> enhanced with my experiences…
>
> Open a terminal …[snip]

bravo!

i suggest you rename this posting as “How to share files between two
openSUSE boxes” and post it to the how-to forum at
http://forums.opensuse.org/information-new-users/unreviewed-how-faq/


DenverD (Linux Counter 282315)
CAVEAT: http://is.gd/bpoMD
posted via NNTP w/TBird 2.0.0.23 | KDE 3.5.7 | openSUSE 10.3
2.6.22.19-0.4-default SMP i686
AMD Athlon 1 GB RAM | GeForce FX 5500 | ASRock K8Upgrade-760GX |
CMedia 9761 AC’97 Audio

I was looking for a solution to the same problem and I think you can go a step further - use “fuse”, aslo known as sshfs.

It gives one advantage - I’m able to use remote files as if they really are on my own system. It doesn’t matter wIth moving of copying data, but in case case of playing a video, for example, fish still copies them to some temp folder on the local machine first and, depending on size, it might take several minutes before the video starts playing, even worse than Samba.

Shfs takes care of it beautifully. Check in Yast that it’s installed and enabled in Runlevels and then mount remote folders with simple

sshfs user@remoteIP: somelocal/mountpoint

It doesn’t matter if username is the same, btw, you can even use only “remoteIP”, without user@ in that case, as the system will assume that you are logging in with the same name as a user on the local machine.

I assume you’ve followed the exchanging public keys procedure to avoid the password prompt.

I’ve dug up this thread because on Suse 11.3 with KDE4 I can’t make this sshfs mounting script run from a link on a desktop. I’ve put it into .sh file, saved in my local /bin directory, added /bin to the $PATH variable and now, if I open the terminal and type “fuse.sh” I get connected in a few seconds, if I create a link to it on the desktop, however, nothing happens, the terminal window opens and stays blank, not even returns to prompt.

There was some change between KDE3 and KDE4 that apparently prevents sshfs from executing from a link. If it’s a test file with echo “hello world!” it works, if it has sshfs line it in it, it doesn’t.

I wonder why and if there’s a way to get it working again, as it still does on my older KDE3 notebook.

On Thu, 29 Jul 2010 13:06:01 +0000, Stan Ice wrote:

> I was looking for a solution to the same problem and I think you can go
> a step further - use “fuse”, aslo known as sshfs.

Just as a point of clarification, fuse stands for “Filesystem in
USErspace” and covers a lot more than just sshfs - sshfs is a filesystem
that leverages fuse.

There are also some issues to be aware of when using fuse filesystems,
though - for example, I wouldn’t be inclined to use them in a multiuser
environment because fuse itself (as I understand it) has no mechanism to
provide file locking on the target system (realistically, how could it -
there’s no “server” running on the remote filesystem). That’s one of the
reasons that most fuse systems will prevent access to the mounted
filesystem for any user other than the one who actually mounted the
filesystem.

But in a single-user environment, I use it myself and quite like it. One
just needs to be aware of the limitations. :slight_smile:

Jim


Jim Henderson
openSUSE Forums Administrator
Forum Use Terms & Conditions at http://tinyurl.com/openSUSE-T-C

Great, any ideas why a script with sshfs won’t run from a .desktop link?

Another thought - I wish someone would write a comprehensive guide to networking Linux boxes. 99% of google results are on connecting Windows to Linux through Samba, and nothing on the said “fuse”, or “fish” or “ntf” and their comparative advantages/disadvantages.

Samba tutorials are great for those who just try to discover Linux but I guess it takes people only a little time to try Linux on two machines and that’s where networking becomes a bit too technical, even though Yast/Dolphin/Konqueror have nice, GUI features for that.

Just as a note - fish:// is not limited to Dolphin - it is a KDE ioslave and can be used in many KDE apps - for example, you can open a document in Kate - just hit ctrl-l if needed to display the file path box and type in fish:// and the IP address (and path if known) and bam - there you go.

Also, while I love Dolphin, and sshfs I find that solutions like Dropbox and Spider oak are really ideal - not only do you share files between two computers - but extend this to any additional ones, across different operating systems. And then you can also access them from anywhere with a web browser, and provide publicly accessible files. They even have a bit of built in version control to go back to previous versions and I believe Spideroak as has data de-duplication. Really, when you look at all these features, it is a **** good road to go for file sharing. And if you loose internet connectivity you still have access locally and any changes will be synced when you have a connection again.

Cheers,
Lews Therin

On Fri, 30 Jul 2010 00:06:01 +0000, Stan Ice wrote:

> Great, any ideas why a script with sshfs won’t run from a .desktop link?

Not without an error message or information about what’s in the .desktop
link. :wink:

> Another thought - I wish someone would write a comprehensive guide to
> networking Linux boxes. 99% of google results are on connecting Windows
> to Linux through Samba, and nothing on the said “fuse”, or “fish” or
> “ntf” and their comparative advantages/disadvantages.

A “comprehensive” guide on networking would be pretty significant,
because “networking” covers more than just file sharing and surfing the
'net. For example, it also covers firewalls, NIC bonding, load
balancing, IPv4, IPv6 (and other protocols), network troubleshooting with
tools like wireshark, running MUD servers, NAT/masquerading, and so on,
and so on.

> Samba tutorials are great for those who just try to discover Linux but I
> guess it takes people only a little time to try Linux on two machines
> and that’s where networking becomes a bit too technical, even though
> Yast/Dolphin/Konqueror have nice, GUI features for that.

Let’s start by identifying some topics, then we can go from there. One
thing I’d like to see is some training/education put together, and if I
can get some topics together, I’m looking to start a project in that area.

Jim

Jim Henderson
openSUSE Forums Administrator
Forum Use Terms & Conditions at http://tinyurl.com/openSUSE-T-C

Here’s my fuse.desktop:

[Desktop Entry]
Categories=Network;
Comment[en_US]=Access the Base
Comment=Access the Base
Exec=fuse.sh
GenericName[en_US]=Remote Folder
GenericName=Remote Folder
Icon=yast-remotechooser
MimeType=
Name=Base
Path=
StartupNotify=true
Terminal=true
TerminalOptions=
Type=Application
Version=1.0
X-DBUS-ServiceName=
X-DBUS-StartupType=none
X-KDE-SubstituteUID=false
X-KDE-Username=

Here’s fuse.sh

#!/bin/bash
sshfs stan@192.168.2.101: HomeBase

Script works like a clock form the terminal but not from desktop link. I don’t know where he error log for this kind of thing is or how to turn it on.

By “comprehensive” I meant file sharing on a homenetwork with a couple of Linux machines, from the user point of view, ie no descriptions of NIC bonding or balance load or ipv6/ipv4 issues.

Just as an example: to share files on your home network you can use NFS, “fish”, “fuse”, …, …, or samba. NFS is suitable for … and …, fish protocol is perfect for … and if you don’t mind …, fuse is useful in … case but be aware of …, and with samba you can do both … and … but not as convenient as …

To setup NFS you need to install and configure both NFS servers and clients and here’s how: open Yast, … , then …

and so on.

These days people have all kinds of devices in the house that can share files - desktops, notebooks, iPads, iPods, all kinds of handheld things that connect over wifi and can play music or movies, the list is endless. I guess they need to enable several protocols at once - samba for windows boxes, … for linux desktops, … for linux notebooks and so on.

On 2010-07-30 06:23, Jim Henderson wrote:
> On Fri, 30 Jul 2010 00:06:01 +0000, Stan Ice wrote:

>> Another thought - I wish someone would write a comprehensive guide to
>> networking Linux boxes. 99% of google results are on connecting Windows
>> to Linux through Samba, and nothing on the said “fuse”, or “fish” or
>> “ntf” and their comparative advantages/disadvantages.
>
> A “comprehensive” guide on networking would be pretty significant,
> because “networking” covers more than just file sharing and surfing the
> 'net. For example, it also covers firewalls, NIC bonding, load
> balancing, IPv4, IPv6 (and other protocols), network troubleshooting with
> tools like wireshark, running MUD servers, NAT/masquerading, and so on,
> and so on.

I think that the openSUSE manuals have some of it. I have some in paper from SuSE times :wink:


Cheers / Saludos,

Carlos E. R.
(from 11.2 x86_64 “Emerald” GM (Elessar))

On Sat, 31 Jul 2010 02:06:01 +0000, Stan Ice wrote:

> Script works like a clock form the terminal but not from desktop link. I
> don’t know where he error log for this kind of thing is or how to turn
> it on.

I notice that you’ve got (in the desktop file) Terminal set to “true” -
when you click the desktop icon, I assume that you get a terminal window
for a brief second, and then it disappears?

Maybe try adding something like:

sleep 60

To the end of the shell script (this will pause the script for 60
seconds) so you can see if there is any error output. I’m wondering if
what’s happening is that sshfs isn’t running because the command’s not
being found (ie, maybe it’s not in the path).

> By “comprehensive” I meant file sharing on a homenetwork with a couple
> of Linux machines, from the user point of view, ie no descriptions of
> NIC bonding or balance load or ipv6/ipv4 issues.

That makes sense - it always helps to have a common vocabulary.
Something like this you would probably find in the docs; depending on
what other operating systems you’re using, you might look to use SAMBA.

Jim


Jim Henderson
openSUSE Forums Administrator
Forum Use Terms & Conditions at http://tinyurl.com/openSUSE-T-C

I’ve not checked this thread for a while but I have also used Filezilla to copy over the ssh connection between an 11.3/KDE4 and another 11.3/KDE4 box and an 11.2/KDE3 without issues. I only wanted to copy large volumes of data (to make 4Gb of stuff available on my laptop) and not burn a DVD.

Cheers.

I’m subscribed to this thread yet I wasn’t notified of two replies, sorry, guys.

Anyway, I went back to it, and solved the problem.

The “sleep 60” idea didn’t work, just a blank terminal, but it prompted me to create a link to the script from elsewhere.

When I ran that “link.sh” in terminal I got “bad mount point error”.

That’s when I realized that “HomeBase” mount is relative to the location the script is run (or called?) from. Changed it ~/HomeBase and it worked.

I must add that I didn’t need “~/” in Suse 11.2

So far fuse is the only way to play high def movies from a remote computer. If I dualboot into Win7 it stutters too much when playin HD videos from remote Suse via samba.

I haven’t tred NFS on a laptop - I don’t need to mount remote folders everytime I boot via fstab, and I’m not sure it wouldn’t copy the whole video before playing it locally.

As for fuse, I guess I discover its pitfalls the hard way, when someone “fuses” into the same system and deletes the video I’m watching half way through without even a warning. Do I understand it correctly?

What other potential problems are there?

On 08/12/2010 05:36 PM, Stan Ice wrote:
>

>
> As for fuse, I guess I discover its pitfalls the hard way, when someone
> “fuses” into the same system and deletes the video I’m watching half way
> through without even a warning. Do I understand it correctly?

Depends. Who owns it?

By default the owner can delete or rename it, others can read it.
This depends on how the permissions for the file/directory are set.

They can be set in many ways.

Vahis

http://waxborg.servepics.com
openSUSE 11.3 (x86_64) 2.6.34-12-default
19:29pm up 1 day 22:32, 4 users, load average: 0.04, 0.03, 0.00