SSHVFS mounts a directory of a remote server over SFTP: its folders and
files appear as they are on the server. Set up the key and server as in SSH setup.
Install
Configure
host also matches a ~/.ssh/config alias, and that entry’s settings apply.
known_hosts turns on host-key checking. Use MountMode.EXEC when python3
or js should run scripts from the mount.
Fields
A private key’s own text, such as one a credential pointer reads from a secret store; offered after
identity_file’s.Path to a
known_hosts file the server’s host key is checked against; unset disables host-key checking.Authentication
The mount offers, in order, the key atidentity_file, then the key text in
private_key, which a credential pointer
can read from a secret store. Without either, it tries the SSH agent and the
default keys in ~/.ssh. passphrase unlocks an encrypted key. password
works too, but a key is preferred.
The server needs SFTP turned on. Reads and writes go as far as the SSH
account’s own file permissions allow.
Layout
root: /remote/logs/app.log is
/srv/data/logs/app.log on the server.
Behavior
- Host keys: checked only when
known_hostsnames a file; unset, any host key is accepted. - Caching: listings are cached for 60 seconds by default. File bytes are
served from cache without a check until the mount’s
ttl:; an SSH mount does not acceptread: fresh. - Running programs: this mount reads and writes files. To run programs on the server, use the SSH machine.
Integration
SSH answers these commands on the server, so fewer files are read. See Integration.grep -randrg:grepon the server finds which files hold the text, then only those are read, so nothing is missed. Every file is read when the server runs no commands (an SFTP-only account), itsgreprefuses an option (busybox), or it cannot read a file.wc -l:wc -lon the server.tail -f:tail -fon the server.md5sum,sha256sumand the other hash commands: the matching sum tool on the server.find: onefindon the server.du: onefindon the server.ls -Randtree: onefindon the server.
VFS.md
The VFS.md an agent reads with SSH mounted at/<path>.
<mode> is the mount’s mode: read, write or exec. The commands shown are
those of a write mount.
- Rendered
- Raw
Virtual Filesystem
Supported Unix Commands for VFSUnix commands work on each path as on a local filesystem, as far as the path supports them:
Limitations of Unix Commands for VFSWhere a path differs from a local filesystem:
Run
man <cmd> or <cmd> --help for one command’s usage.