ssh filesharing.

By Hal Canary, 2009-05-24 15:20:33 (link)
#computers-code

R. was looking for an easy way to share files among the computers in his house, most of which ran some version of Linux. SSH offers one solution to this question. Pro: it is available on all the Linux computers, is integrated with Gnome, allows shell as well as file access, and is secure over a wireless network. Cons: Poor support in Windows.

To set up:

1) Install the OpenSSH Dæmon. In Ubuntu, for example, "sudo apt-get install -y openssh-server" will install it.

2) Get the local address of each machine with:

/sbin/ifconfig | grep 'inet addr' | awk '{print $1 " " $2}'

3) Give each machine a unique and memorable hostname. Hostnames can be changed permanently by changing the contents of the file /etc/hostname (on debian-style systems) and until the next boot with "sudo hostname NEWNAME".

4) Edit the file /etc/hosts on each computer to list all of the local IP addresses for each computer on the network. (Under Windows, it's "%SystemRoot%\system32\drivers\etc\hosts" and under MacOSX it's "/private/etc/hosts".

5) In Gnome, open the file browser Nautilus ("nautilus" from the command line)→menu bar→File→Connect to server. In the dialog, select "Service type" to be SSH, give the hostname, and username only if it's different on the two computers.

Alternatively, one can enter "nautilus sftp://USERNAME@HOSTNAME/DIRECTORY" on the command line.

In recent versions of Nautilus/Gnome, you can bookmark locations like this. Then they will be availible from the Gnome Menu→Places→Bookmarks.


(back)