FTP, rsync, SCP — there are many ways to access remote files. SSHFS is the most transparent: you mount a folder on a remote server as a local drive. You simply work with it via the Finder, your editor or the terminal, as if the files were stored locally. No extra ports, no separate protocol — just SSH.
Installation
macOS
brew install sshfs
On newer versions of macOS, you’ll also need macFUSE. Install it first via the website or using
brew install --cask macfuse.
Ubuntu / Debian
sudo apt install sshfs
Arch Linux
yay -S sshfs
Fedora / Red Hat
sudo dnf install sshfs
Mounting a remote folder
Step 1 — Create a local mount point:
mkdir -p ~/shares/server
Step 2 — Mount the remote drive:
sshfs gebruiker@server.nl:/pad/naar/map ~/shares/server
Replace:
user→ your username on the remote serverserver.nl→ IP address or hostname/path/to/folder→ the path on the server that you want to mount
Step 3 — Navigate through it as you would a normal folder:
cd ~/shares/server
ls -la
Or open it in Finder on macOS:
open ~/shares/server
Useful options
# Use a different SSH port
sshfs -p 2222 gebruiker@server.nl:/pad ~/shares/server
# Automatically reconnect if the connection is lost
sshfs -o reconnect gebruiker@server.nl:/pad ~/shares/server
# Specify the SSH key explicitly
sshfs -o IdentityFile=~/.ssh/id_ed25519 gebruiker@server.nl:/pad ~/shares/server
# Combination
sshfs -p 2222 -o reconnect,IdentityFile=~/.ssh/id_ed25519 gebruiker@server.nl:/pad ~/shares/server
Unmount
# macOS
umount ~/shares/server
# Linux
fusermount -u ~/shares/server
Mount automatically on login
If you want to make the mount persistent, add it to /etc/fstab (Linux):
gebruiker@server.nl:/pad /home/you/shares/server fuse.sshfs defaults,_netdev,IdentityFile=/home/you/.ssh/id_ed25519 0 0
On macOS, you can create a login item or launchd plist that runs the sshfs command when you log in.
Safety
- Use SSH keys instead of passwords — faster and more secure
- Restrict SSH access via the firewall to trusted IP addresses
- Run SSH on a non-standard port to automatically reduce scanning traffic
- Use
AllowUsersin/etc/ssh/sshd_configto restrict access to specific users
Do I need a separate programme in addition to SSHFS?
No, SSHFS is based on SSH — you just need an existing SSH connection. On macOS, however, you do need macFUSE as a dependency.
Does the mount remain active after a restart?
No, not by default. Add the mount to /etc/fstab or use a login item or systemd service to restore it automatically.
Is SSHFS secure?
Yes — all traffic is routed via SSH. Use SSH keys instead of passwords for added security and convenience.
Lees het origineel in het Nederlands
← Lees in het Nederlands