Code Yarns ‍👨‍💻
Tech BlogPersonal Blog

How to mount remote directory using SSHFS

📅 2014-Sep-10 ⬩ ✍️ Ashwin Nanjappa ⬩ 🏷️ ssh, sshfs ⬩ 📚 Archive

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.

$ sudo apt install sshfs
$ mkdir my_local_dir
$ ssh my_remote_login@my_remote_computer
$ sshfs my_remote_login@my_remote_computer:/some/remote/path my_local_dir

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

$ sshfs -o reconnect my_remote_login@my_remote_computer:/some/remote/path my_local_dir
$ fusermount -u my_local_dir

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