$linuxjunkies
>

sshfs(1)

Mount a remote filesystem over SSH using FUSE.

UbuntuDebianFedoraArch

Synopsis

sshfs [OPTION]... USER@HOST:[DIR] MOUNTPOINT

Description

sshfs is a filesystem client based on SSH (Secure Shell) that allows you to mount a remote directory locally over an encrypted SSH connection. It uses FUSE (Filesystem in Userspace) to provide transparent access to files on a remote server without requiring root privileges or special server configuration beyond SSH access.

All file operations are tunneled through SSH, making it useful for secure remote file access, backups, and collaborative work. The mounted filesystem behaves like a local directory, supporting standard file operations, permissions, and symlinks.

Common options

FlagWhat it does
-o allow_otherAllow other users (besides the one who mounted it) to access the filesystem
-o IdentityFile=KEYSpecify a private key file for SSH authentication (e.g., ~/.ssh/id_rsa)
-o port=PORTConnect to SSH server on a non-standard port (default 22)
-o reconnectAutomatically reconnect if the SSH connection is lost
-o StrictHostKeyChecking=noSkip SSH host key verification (use with caution)
-o follow_symlinksFollow symlinks on the remote server
-o no_readaheadDisable read-ahead for remote file access
-o cache=noDisable caching of file attributes and directory listings
-o ConnectTimeout=SECSSet SSH connection timeout in seconds
-CEnable SSH compression

Examples

Mount the remote /home/user/documents directory to ~/remote-docs using SSH credentials

sshfs [email protected]:/home/user/documents ~/remote-docs

Mount with a specific SSH private key for authentication

sshfs -o IdentityFile=~/.ssh/custom_key [email protected]:/var/www ~/webserver

Mount using a non-standard SSH port (2222) with automatic reconnection

sshfs -o port=2222,reconnect [email protected]:/data ~/mnt/remote-data

Mount allowing other system users to access the filesystem

sshfs -o allow_other [email protected]:/shared ~/shared-mount

Unmount an sshfs-mounted directory

fusermount -u ~/remote-docs

Optimize for slow network connections by disabling caching and read-ahead

sshfs -o no_readahead,cache=no [email protected]:/home/user ~/slow-connection

Related commands