Skip to main content

sshfs. Mount remote directories via SSH protocol

Jose CerrejonLess than 1 minuteRaspberry PILinuxRaspberry PILinux

sshfs: Mount remote directories via SSH protocol


In my day to day I use Ubuntu installed on iMac (the teasing that I can receive, I know). When I remotely access my Raspberry Pi or other equipment with Linux, I usually use Filezilla, but I discovered a cool way to access my directories through the main operating system through sshfs...

This command will allow us to mount our file system on a remote directory on another computer. To do so simply install it first and create the folder where it was mounted:

sudo apt-get install -y sshfs
mkdir rpi

Load the module with: modprobe fuse

Mount inside our operating system the remote directory with:

sshfs user@server:dir_remote dir_local

An Example: sshfs pi@ /home/ubuntu/rpi

With this we'll have the pi directory on another computer, no matter if it is on the local network or in the cloud. If we want to unmount it before turning the Pi off: fusermount -u /dir_local (Following the example: fusermount -u /home/ubuntu/rpi).

[ Connect from OSX ]

Remote Login
Remote Login

If you want to share a folder from OSX, the last steps must be executed from the Pi, but first you must to enable remote login through Apple menu > System Preferences > Sharing > Select Remote Login.

More info: > How To Mount Remote Directory With SSHFS on a Linuxopen in new window