Sharing directories over a network with sshfs

by rgrunber

Occasionally, you may find yourself in a situation where you need to access files from another machine on your network. As an example, I use Eclipse Mylyn for managing a large amount of bugs I care about, across various bug tracking systems. I keep this data in one central location and it’s simple enough to share across Eclipse workspaces on the same machine. But what if you want to access that data from another machine ?

In cases where things haven’t been set up ahead of time to allow for NFS (and to be honest, I haven’t really used NFS in a while) one can get away with using SSHFS (an already running SSH daemon seems more common). However, if the network is already trusted, then encrypting that data is just slowing things down. Although we can’t disable encryption outright, we can certainly optimize for speed by choosing a fast cipher.

For the purpose of this post, we assume that both machines communicate over a trusted network.


$ sshfs -o Ciphers=arcfour -o Compression=no user@192.168.122.2:/data/mylyn-data /tmp/mylyn-data

From here, we can pass /tmp/mylyn-data as the task directory for Eclipse Mylyn.
If you ever find your ssh connection has been improperly terminated while the mount point was active, one might need to issue the following command to properly unmount.


$ fusermount -u /tmp/mylyn-data

Advertisements