How to mount remote directory using SSHFS

Samba (SMB) and NFS can be too complicated to mount directories between computers on a home network. If both the remote and local computers are running Linux then an easier method is to use SSHFS.

  • Installing SSHFS is easy:
$ sudo apt install sshfs
  • Create a local directory where you want to mount the remote directory:
$ mkdir my_remote_contents
  • Make sure you can already SSH to your remote computer:
$ ssh my_remote_login@my_remote_computer
  • To mount your remote directory using SSHFS to the local directory you created earlier:
$ sshfs my_remote_login@my_remote_computer:/some/remote/path my_remote_contents

Now you can browse the directory both from shell or any GUI file explorer. All normal file operations works seamlessly, including deletion.

  • To unmount the remote directory:
$ fusermount -u my_remote_contents

Note that your user needs to have sudo permissions to be able to unmount the directory.

Tried with: SSHFS 2.5 and Ubuntu 14.04

2 thoughts on “How to mount remote directory using SSHFS

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.