How to mount remote file systems via SSH

By Angus Published 18 April 2025 Updated 27 January 2026 3 min read

Mounting remote file systems securely over SSH is a practical way to access files on another server as if they were stored locally. This is particularly useful as part of managing your VPS, whether you’re backing up data, working across development environments, or managing files from multiple servers.

This guide explains how to install and use SSHFS to utilise SFTP (SSH File Transfer Protocol) for mounting remote directories with SSH, and how to make those mounts persistent across reboots.

Install SSHFS on Your System

Before mounting a remote directory, you need to install the SSHFS client. How you do this depends on your chosen distribution and its package manager below shows example commands for both debian and RHEL based systems using apt and dnf respectively.

For Debian-based systems (Ubuntu, Debian, Linux Mint):

sudo apt update
sudo apt install sshfs

For RHEL-based systems (Fedora, CentOS, AlmaLinux, Rocky Linux):

sudo dnf install sshfs

Create a local mount point

To access the remote filesystem locally, you need a directory to mount it to. You can start by creating one with mkdir.

mkdir /backup

Mount the remote directory via SSH

Now, mount the remote folder using sshfs . The basic syntax is:

sshfs user@remote_host:/remote_path /local_mount_point

For example to mount the /home directory from a remote server at 192.168.1.10 to the local /backup folder you would use:

sshfs root@192.168.1.10:/home /backup

You’ll be prompted to enter the SSH password for the user. After authentication, the remote directory will be accessible under /backup.

If you’re experiencing connection issues, you may need to disable strict host key checking for automated mounting scenarios.

Set up passwordless SSH authentication

Repeated password prompts can become tedious. To simplify access, you can manage SSH keys for secure, passwordless connections:

  1. Generate an SSH key if you haven’t already:
ssh-keygen
  1. Copy the public key to the remote server:
ssh-copy-id root@192.168.1.10

This allows secure, passwordless connections via SSH for all future mounts.

Configure mounts with fstab

1. To ensure the remote file system mounts automatically at boot, add an entry to the /etc/fstab file.

sudo nano /etc/fstab

2. Now add this line, replacing user, host, and paths as needed:

sshfs#root@192.168.1.10:/home /backup fuse.sshfs defaults 0 0

3. Save the file and reboot the system:

sudo reboot

After reboot, the remote directory should be automatically mounted.

Troubleshooting common issues

Connection timeout

Ensure the remote server is accessible and SSH is running on the expected port.

Permission denied

Check that your SSH key has the correct permissions (typically chmod 600 ~/.ssh/id_rsa) and that the remote user has access to the directory you’re trying to mount.

Mount point busy

If you can’t unmount a directory, check if any processes are using it with lsof /backup, then close those processes before unmounting.

Need more power?

Get scalable resources with our VPS hosting with root access and optional software.

Get VPS Hosting

Starting something new?

Perfect for websites and small businesses unlimited bandwidth with cPanel hosting.

Get cPanel Hosting