Mount remote SSH drives in Ubuntu with SSHFS

Posted under » Ubuntu » Linux on 19 March 2012

Network is essential. Rsync has been useful but sometimes you need to access a file as if the file is local. I've used other solutions like Open AFS, Onedrive, Samba and the likes but this is the best solution IMHO. However you need a good and stable internet connection for this to work flawlessly.

SSHFS is a tool that uses SSH to enable mounting of a remote filesystem on a local machine; the network is (mostly) transparent to the user. Because SSHFS authenticates connections, you can be sure that only those who should have access to remote directories can mount them (as long as everything is configured properly).

You do not need to be root to do this but you must belong to the fuse group. You have to install this because it is not a standard installation.

$ apt install sshfs

In this example, the remote directory is /projects on remote host "myserver.com". The local mount point is ~/far_projects.

$ mkdir ~/far_projects
$ sudo sshfs -o allow_other,default_permissions ubuntu@myserver.com:/projects ~/far_projects

~/far_projects will appear like a mounted drive. To unmount

$ sudo umount ~/far_projects

Sometimes, things go wrong and you get this kind of error. "fuse: bad mount point" and "Transport endpoint is not connected". The solution is to


web security linux ubuntu python django git Raspberry apache mysql php drupal cake javascript css AWS data