Mounting remote directory using sshfs

SSHF provides a secure way to access remote machines on the fly via the Secure Shell File Transfer Protocol (SFTP). It stands for Secure Shell File System and it is a software developed for use on Linux distributions.

1: Download and install the fuse-sshfs package

The SSHFS package is not included in any of the repositories on the Linux Operating System. You will have to download the rpm package for fuse-sshfs to your machine or you can use the yum command if you have access to an online repository.

After downloading the rpm package, go to the terminal of the local machine, migrate to the directory that has the downloaded package and then use the rpm command to install the rpm package for the sshfs

For the purpose of this demonstration I have created a directory “test” in the remote machine
In that directory is a text file “testfile” that says “This is a test file to demonstrate SSHFS

2: Create a mount point on the local machine
– On the machine where the SSHFS is installed, log in as root and create a mount point. I am going to call mine server22 and an ll command on that directory should show it is empty.

3: Mount the remote directory on the local machine
– Now mount the remote directory with the syntax

sshfs remote-machine-name@ip-address:directory-path /mount-point

It should ask you for the password of the remote machine when you hit the enter button. Input the required password.

Now migrate to the mount point/directory, and do the “ll” command; if all is well, you should see the files in the mounted directory of the remote machine.

Most servers already support this protocol it is very easy to set up. On the client-side mounting, the file-system is as easy. We don’t have to do much configuration on the server-side. All you need is the remote server should have a working SSH server.

Notify of
Inline Feedbacks
View all comments
Would love your thoughts, please comment.x