[NTLUG:Discuss] sshfs mounting of remote filesystems

Patrick R. Michaud pmichaud at pobox.com
Sun May 16 11:16:09 CDT 2010


I mentioned sshfs during yesterday's meeting, so thought I'd
follow up a bit here.  Sshfs allows one to mount a remote filesystem
over ssh, much like one can do using nfs or samba.

On my system (Kubuntu), I simply install the sshfs package:

    sudo apt-get install sshfs

And afterwards I can mount directories via ssh.  For example, on
my notebook computer I will often mount my desktop home directory
(the desktop is named 'orange'):

  $ mkdir orange-home
  $ sshfs 192.168.1.11: orange-home
  The authenticity of host '192.168.1.11 (192.168.1.11)' can't be established.
  RSA key fingerprint is 17:b2:40:5a:6b:8a:94:bb:d0:b7:dc:49:a7:09:f2:4c.
  Are you sure you want to continue connecting (yes/no)? yes
  pmichaud at 192.168.1.11's password: 
  $ ls orange-home
  bin        parrot                 work
  c-qa       PDF                    year
  Desktop    plum.sysinfo.20100429  zip
  mapadapt   pugs
  nqp-rx     rakudo
  $ 

Note that the mount can be done by an ordinary user, not requiring
super-user privileges. All communications are of course ssh-encrypted
and use the standard ssh-authentication mechanisms, so if I have a
.ssh/authorized_keys file set up on the remote, I can even bypass the
password prompt.

Another use for sshfs: Since my Android phone has a ssh server on it 
(QuickSSHD, http://teslacoilsw.com/quicksshd), I also use sshfs to 
remotely mount my phone's SD card to view files and manipulate
files directly on the phone via wifi.  Or even use rsync.  :-)
*Much* easier than trying to transfer via bluetooth or usb cable.
(The phone can even be in the next room!)

And for people who want to mount a remote Linux directory under
Windows but don't want to (or can't) configure Samba, there's a
package called ExpanDrive (http://www.expandrive.com/) that
uses ssh (sftp) to mount a remote directory as a local Windows drive.
I've found this to be very useful for our home network where
everyone else is using Windows to try to save/view files on my
Linux server.  Best of all, file access control is then completely
controlled by the Linux usernames/passwords I set up (or other
standard ssh mechanisms), there's no need to maintain a separate 
set of Samba usernames and passwords.

Just some thoughts for people looking for other ideas.  I don't
know that these tools would be useful in enterprise environments, 
but for personal use I've found them to be extremely handy.

Pm



More information about the Discuss mailing list