Mount Remote Folder Via SSH Using SSHFS

If you do any kind of web or application development, then you’re used to working with remote servers and systems. You work locally, create test cases and do some kind of qa before deploying to the live system. But what if your qa / test system is also remotely? Wouldn’t it be nice if you could just work as if your files were local and have changes sync automatically? Mounting a remote folder using sshfs makes it possible.Be careful as all changes are reflected on your remote server immediately and without warning.

If you’re often working with remote servers, directories and files, then you know how annoying it can become to constantly sync your content using ftp, ssh, sftp or some other method.

Following are the steps necessary to accomplish this:

- Install sshfs ($sudo apt-get install sshfs) . This will also install fuse-utils and libfuse2, which are required.

- Create a folder to serve as mount location ($ mkdir ~/mount/some-name)

- Add your user account to the user group “fuse”, so that you will have the appropriate rights for sshfs ($sudo adduser your-username fuse)

- Log off and log back in. This step is necessary for the account changes to take effect.

- Mount the remote filesystem with the following syntax: sshfs user@host:/remote-folder local-mount  (sshfs user@example.com:/web ~/mount/localweb)

That’s it, you should now have a local folder with all the files from the remote location.


  • Digg
  • Facebook
  • Twitter
  • StumbleUpon
  • Windows Live Favorites
  • Yahoo Buzz
  • Share/Bookmark

2 Comments

JimMarch 24th, 2009 at 4:09 pm

Thanks for the instructions. Really helpful.
Btw, can you use subversion using sshfs mount?

PeterMay 1st, 2009 at 6:13 pm

Yes, should work.
Just use file:// or svn:// and not svn+ssh:// to access the repository once mounted.

Leave a comment

Your comment