Mounting a Remote Folder Locally with sshfs
How to mount a folder from a remote server on your machine with sshfs, so you can edit server files in your local editor.
bash
Install sshfs
# Ubuntu / Debian
sudo apt install sshfs
# macOS (install macFUSE first)
brew install gromgit/fuse/sshfs-macCreate a Local Mount Point
mkdir -p ~/remoteMount the Remote Folder
To mount a folder from the server (remote-server) on your machine, run:
sshfs user@remote-server:/home/user/project ~/remote -o reconnect,ServerAliveInterval=15user@remote-server:/home/user/project→ The remote folder to mount.~/remote→ The local folder where it appears.-o reconnect→ Reconnects automatically if the connection drops.-o ServerAliveInterval=15→ Keeps the connection alive when idle.
Now, open ~/remote in your local editor and edit the server files as if they were on your machine.
Note: Every file read goes over the network, so searching or indexing large
folders (datasets, node_modules, checkpoints) will be slow. Open only the
folder you need.
Unmount the Folder
# Linux
fusermount -u ~/remote
# macOS
umount ~/remoteThis setup lets you work on server files with your own editor and settings!