Simon Zimmermann

2010-02-28

Sshfs

I just found out about sshfs yesterday. Saved me some headache. Don’t even know why I haven’t done this earlier. If you have some sort of testing environment on a remote server it’s so nice to be able to poke around using gedit rather then vi:m or nano. Well, usually I would just write a small bash-snippet which basically would call scp and update my files. Now I can just click Ctrl+s from my favorite text-editor and they’ll get updated.

I even wrote a stupid python script which does the mounting, unmounting. It depends on Fabric. Just because I was poking around with Fabric at the time of figuring out the sshfs thing.

from fabric.api import local

mntpoint='remote/'

def mount(): local('mkdir -p '+mntpoint) local('sshfs -p <port> -C -o transform_symlinks -o Cipher="arcfour" <user>@<host>: '+mntpoint)

def unmount(): local('fusermount -u '+mntpoint) local('rm -R '+mntpoint)

The Cipher part is to speed up SSH, which other wise can feel kind of laggy. Make sure you have fuse enabled(# modprobe fuse) and run $ fab mount/unmount to mount or unmount.

robotics github