Wednesday, March 26, 2008

Mounting File Systems with Ssh and Fuse

Yesterday, I mounted my laptop, at home, from my desktop, at work, with ssh. Not NFS, not Samba: ssh. Different domain, different location. Secure, fast, hassle-free.

I started with a recipe out of a book I got for Christmas, Carla Schroeder's Linux Networking Cookbook, then Googled around until I found a mount table entry that would do the trick. Now, I can just say mount /mnt/sshfs from my desktop, at work, and my home directory from my laptop at home appears.

Here's the fstab entry from the work box:

sshfs#user@laptopname:/home/user /mnt/sshfs fuse port=portnumber,user,noauto 0 0

You also need to install FUSE, the "filesystem in user space" module, (apt-get install fuse), and, of course, ssh, but I'd already done those for other reasons.

The whole shebang goes by the name sshfs.

(Wikipedia's FUSE entry, linked to above, says there's even user-space filesystem built on Gmail.)

No comments: