Ssh – How to share files between two Linux machines over LAN

fedorafile-sharingprivate-networksambassh

I am currently running Fedora 18 with Gnome on two computers which are connected to the same router. I have been using Samba to share files between the two, but I know there must be a better way.

On the left panel in Nautilus, there is a menu for me to access my other computer's shared directories via Network -> Browse Network -> Windows Network -> Computer. What is the way to accomplish a similar way to access a shared directory between two Linux machines, without going through the "Windows Network"?

Preliminary research suggests that using SSH to mount a remote directory may be what I'm looking for, but when I SSH into the other computer, I am left at the console scratching my head. If that is the correct method, I would greatly appreciate it if someone would offer some insight on how to accomplish the sharing.

Best Answer

In Nautilus, select File | Connect to Server ...

There are a lot of options to share a file-system over a network in unix/linux. Nautilus supports some of them: ssh, webdav, ftp, smb and others. Obviously, any of these solutions requires that the corresponding daemon is running on remote host.

NFS is unix native "standard" way to share a file-system in a lan but the time needed to configure and manage such a solution is not worth the result in a so simple network as yours. IMHO, ssh is the best solution in your environment.

Usually ssh is used to log on and to execute commands on a remote machine. The way you connect to the remote machine is not the way to share a file-system but the way to execute remote commands. If you want to mount a remote file system via ssh via command line, try something like: sshfs remoteusername@host:/home/remoteusername /home/localusername/somedir (or use nautilus wizard).

Related Question