For Linux clients, SSHFS (SSH Filesystem) is another great tool to use.  It is a sub-system that comes with an SSH server and is enabled by default, based on FUSE for mounting remote directories over an SSH connection. Instead of setting up an entirely new server or process for making remote directories and folders available to users, you can use your existing SSH server to do that. No need for additional configurations or FTP servers. This brief tutorial shows students and new users how to install and configure SSHFS on Ubuntu 18.04 | 16.04 LTS servers. When you’re ready, follow the steps below:

Installing SSHFS on Ubuntu

SSHFS packages are available in Ubuntu’s default software repositories. So all you need to do to install it is to run the commands below: After installing it, continue below to learn how to mount directories.

Mounting SSHFS Directories

Now that SSHFS is installed, you can use the mount command to access remote directories over SSH via SSHFS. The SSHFS mount command format is shown below: To mount a remote directory locally on your Ubuntu machine, you first create a location or mount point that will be synced with the remote side. Run the commands below to create a folder called sshfs in your home folder. This is where the remote folder will be mounted and accessed locally. You can then use the count commands to mount the remote directory locally through SSHFS. Replace “richard” with the actual username created on your server and “192.168.10.2” with the actual IP address of your remote instance. To unmount the directory above, you run the commands below: To avoid typing the password each time you mount the remote directory, you can read this post to learn how to configure SSH key authentication. With it, you won’t have to time your password every time you want to mount the remote directory. Permanently Mount Remote Folder on Local Machine If you want to permanently mount the remote directory you need to edit the local machine’s /etc/fstab file and add a new entry. Doing this will always keep the mount point available even if you reboot your machine. This way when your system boots up it will automatically mount the remote directory. To mount a remote directory over SSHFS from /etc/fstab, use fuse.sshfs as the filesystem type. Run the commands below to open the /etc/fstab file. Then add the line below into the file and save. You should make sure that password-less SSH authentication is enabled on the SSH server you’re connecting to so you don’t always have to enter a password. Windows users can mount the remote location using the commands below using programs like SSHFS-Win and WinFsp That should be it! Congratulations! You have learned how to install and enable SSHFS and mount remote directories successfully. You may also like the post below: