SSH Filesystem

Holy cow, this about blew my mind. I was working on a simple little website that had no FTP access so I was just planning on copying all the files down to check out the site and see how things were working. Obviously it is not fun to do that. Well I did have SSH access to the server and so I was trying to see what images were which, well, I didn’t really want to scp all the files I wanted to preview one-by-one. Oh, and I didn’t have root access and wasn’t sure if it had NFS available or not. That’s when I found out about sshfs!

With sshfs I can mount all the files locally over an SSH connection! To do this I:

sudo apt-get install sshfs

Edit /etc/modules and add a line that says ‘fuse’ if it is not there already

Add myself to the fuse user group:

sudo adduser username fuse

Then just mount the filesystem:

sshfs username@host:/path/to/remote/files /media/mount-point

Then to unmount do:

fusermount -u /media/mount-point

That’s it. It was so nice to work on all the files using my local tools and apps. Obviously this is not the best idea for changing a production server but it just provides a little nicer look at the remote files.