Mounting a remote directory over SSH makes files on another system appear under a normal local path, which is useful for editing content, reviewing logs, or copying small groups of files with ordinary local tools instead of repeated upload or download commands.
SSHFS is a FUSE client that talks to the SFTP subsystem in OpenSSH. Most SSH servers expose SFTP already, so the main requirements are a working SSH login, the correct remote directory path, and a local mount point owned by the local user that will access the files.
The local Linux system needs the sshfs client and the FUSE 3 userspace helper already installed. Run SSHFS as the regular local user rather than root, keep the mount point empty before mounting, and prefer key-based authentication for repeated mounts; -o reconnect together with -o ServerAliveInterval=15 helps the client recover more cleanly after dropped sessions.
Related: How to copy files over SSH
Related: How to configure passwordless SSH login
Steps to mount a remote filesystem with SSHFS:
- Confirm that the remote account can log in and list the target directory over SSH.
$ ssh user@host.example.net 'hostname && ls /home/user/remotefolder' host readme.txt
SSHFS uses the same remote account permissions as plain SSH or SFTP, so a path that cannot be listed here will not mount cleanly later.
- Create an empty local mount point owned by the local user that will access the files.
$ mkdir -p /home/user/remote
Files already present under /home/user/remote stay hidden while the remote filesystem is mounted there.
- Mount the remote directory with SSHFS.
$ sshfs -o reconnect -o ServerAliveInterval=15 user@host.example.net:/home/user/remotefolder /home/user/remote
If the username is omitted, SSHFS uses the current local username. If the remote directory is omitted, SSHFS mounts the remote home directory.
- Check that the mount is active and points at the expected remote path.
$ findmnt /home/user/remote TARGET SOURCE FSTYPE OPTIONS /home/user/remote user@host.example.net:/home/user/remotefolder fuse.sshfs rw,nosuid,nodev,relatime,user_id=1000,group_id=1000
The FSTYPE value commonly appears as fuse.sshfs even though the client command is sshfs.
- List the mounted directory to confirm that remote files are available through the local path.
$ ls /home/user/remote readme.txt
- Create a test file through the mount when write access is required, then confirm that it exists on the remote host.
$ touch /home/user/remote/file.txt $ ssh user@host.example.net 'ls -l /home/user/remotefolder' total 4 -rw-rw-r-- 1 user user 0 Apr 14 12:15 file.txt -rw-rw-r-- 1 user user 13 Apr 14 12:15 readme.txt
Write access through the mount still follows the remote directory ownership and permissions, so a failure here is usually a remote permission problem rather than a local mount problem.
Mohd Shakir Zakaria is a cloud architect with deep roots in software development and open-source advocacy. Certified in AWS, Red Hat, VMware, ITIL, and Linux, he specializes in designing and managing robust cloud and on-premises infrastructures.
