Tips&Tricks

How to mount a remote directory to a local file system

SSH (Secure Shell) is a protocol to providing an encrypted channel for logging into another computer over a network and work there.

First of all we need to install sshfs (see also “How to transfer a file from local path to SSH server“).

SSHFS (SSH Filesystem) is a filesystem client to mount and interact with directories and files located on a remote server or workstation over a normal ssh connection.

MacOS:

brew install sshfs

Ubuntu:

sudo apt install sshfs

Other *nix: I think you understand the basic idea 🙂

Mount the remote directory as a local directory:

sshfs {{username}}@{{remote_host}}:{{remote_directory}} {{mountpoint}}

For example:

sshfs USER@REMOTE_HOST:/path/to/remote_directory \ 
/home/user/local_directory