sshfs mounts a remote directory over SSH and presents it as a local filesystem — files open in your editor, tools grep it, builds read it, all without a single scp round trip. If you can SSH there, you can mount there; there is nothing to install on the server.
Mount and unmount #
$ mkdir -p ~/remote/build
$ sshfs ana@build.aospix.com:/srv/app ~/remote/build
$ ls ~/remote/build
releases logs config.toml
$ fusermount -u ~/remote/build # or: sudo umount ~/remote/build
From mount to unmount, ~/remote/build is /srv/app on the remote machine — every read and write travels the SSH connection, encrypted, authenticated by your existing keys. An entry in ~/.ssh/config makes the command as short as sshfs build:/srv/app ~/remote/build.
Options that make daily use pleasant #
$ sshfs -o reconnect,ServerAliveInterval=15,ServerAliveCountMax=3 \
-o idmap=user \
build:/srv/app ~/remote/build
| Option | Effect |
|---|---|
reconnect | Survive dropped links instead of hanging forever |
ServerAliveInterval=15 | Detect dead connections in seconds, not minutes |
idmap=user | Remote UIDs translate to your local user |
-o ro | Read-only mount — safety for browsing production |
follow_symlinks | Follow remote links instead of showing them dangling |
The reconnect pair matters most: without it, a laptop sleep or Wi-Fi blip leaves every process touching the mount frozen in disk-wait. With it, the mount recovers or fails fast.
What it is good at — and not #
Good: editing config files on a server, browsing logs with local tools, working on a few files deeply, dragging a project into a local git workflow. The latency is your SSH latency, so interactive editing of single files feels nearly local.
Not good: anything that stat()s thousands of files — builds, find across trees, npm installs, git status in a huge repo. Each metadata call is a network round trip; a local git status costs milliseconds, over sshfs it costs a coffee. For repeated bulk sync, rsync; for one file, scp.
Never power off or sleep with an sshfs mount busy: processes block on it, and a forced unmount with fusermount -uz is the unstick. If a mount hangs hard, umount -l (lazy) releases your side without waiting for the dead network.
The transport underneath is ssh with all its tuning; the alternatives for each use case are scp and rsync. The network series continues.
