sshfs is an external tool and can be installed with
sudo apt install -yq sshfs.
You server is at
example.com. To mount a directory from server, execute
sshfs example.com:<remote dir> <local dir>.
<remove dir> and
<local dir> must exist. And
<local dir> must be empty.
Disk space is occupied in the remote server, not in local.
To unmount, use
fusermount -u <local dir>.
To auto reconnect and periodically ping server, in order to prevent disconnection. Add this flag
-o reconnect,ServerAliveInterval=30,ServerAliveCountMax=100 after
If you use mounted directory to mount to a docker volume. There will be an error similar to the following
Error response from daemon: Cannot restart container csgo-dedicated2: OCI runtime create failed: container_linux.go:346: starting container process caused "chdir to cwd ("/home/steam/csgo-dedicated") set in config.json failed: permission denied": unknown
In that case, you should add
-o allow_other to the
sshfs command. Please remember to unmount the volume first, before re-mount with this option.
If it happens another permission error, you should go to the remote PC (the owner of the storage). Then change the owner/group IDs of the directory to be the user/group of the user used in the
sudo chown <username or id> <dir path> sudo chgrp <group name or id> <dir path>