How to Mount Remote Directories with SSH (+Video Tutorial)

How to Mount Remote Directories with SSH (+Video Tutorial)

Learn how to easily mount remote directories with the help of a more secure SSH tool. Follow along with Jack Wallen in our step-by-step tutorial.

Écrit par
Jack Wallen
Jack Wallen
Oct 11, 2023
We may earn from vendors via affiliate links or sponsorships. This might affect product placement on our site, but not the content of our reviews. See our Terms of Use for details.

Do you have remote directories you need to mount on your local desktop so you can work on code, configurations, documentation or just about any kind of file? If those remote files are on a server and you don’t want to share them via the less secure Samba, Secure Shell has you covered.

Thanks to an app called Secure Shell File System (a.k.a. sshfs), you can easily mount remote directories, with the help of the more secure SSH tool. Let me show you how it’s done. I’m going to demonstrate on an Ubuntu-based Linux distribution, so if you use a different OS, you’ll need to modify the installation command.

  1. To install sshfs, open a terminal window and issue the command:
    sudo apt-get install sshfs -y

    Once the application is installed, you’re ready to use it.

  2. Let’s say you want to mount your home directory on a machine at IP address 192.168.1.60 and mount it on a local directory called MOUNT. To do that, the command would be something like this:
    sshfs USER@192.168.1.60:/home/USER /home/USER/MOUNT

    where USER is your username. You’ll be prompted for the remote user’s password.

  3. Upon successful authentication, the remote directory will be mounted in the MOUNT directory. You can verify this by issuing the command:
    ls MOUNT

    from within the parent directory housing MOUNT, and you’ll see a listing of the remote directory contents. Now you can open those files as though they were on your local machine.

And that’s how easy it is to mount a remote directory to your local machine with the help of sshfs. This method is more secure than using a Samba share and is far easier than NFS. Give sshfs a try and see if it makes your workflow easier.

Subscribe to TechRepublic’s How To Make Tech Work on YouTube for all the latest tech advice for business pros from Jack Wallen.

Jack Wallen

Jack Wallen is an award-winning writer for TechRepublic, The New Stack, and Linux New Media. He's covered a variety of topics for over twenty years and is an avid promoter of open source. For more news about Jack Wallen, visit his website jackwallen.com.