Mount a directory over SSH using SSHFS

With SSHFS, you can mount a remote directory over SSH.


A convenient way to access your server’s files is to use SSHFS. With this tool, you can mount a directory from a server into the local filesystem over SSH. It can be handy, for example, if you’re doing web development and need to edit files.

Start by downloading and installing SSHFS:

Command
sudo apt-get install sshfs

Create a directory where you want to mount the remote server's file:

Command
mkdir ~/sshfsmountdirectory

Now, let's mount the remote directory from the server:

Command
sshfs exampleuser@remoteip:/home/user/svn ~/sshfsmountdirectory

All commands may need to be adjusted to include your username, your directory names, and so on.

Now you’re free to edit the files and see how they change directly on the server.

Unmounting the remote directory

To unmount the remote directory, run:

Command
fusermount3 -u ~/sshfsmountdirectory

Last updated

Was this helpful?