So I used sshfs to Mount a Remote Filesystem
This is the one Linux way to edit files remotely as if they were local. For a Windows approach, see my post on WinSCP. There’s also a Windows sshfs called Dokan SSHFS.
sshfs is a user-space Linux filesystem that makes an ssh connection look like a local filesystem.
It’s trivial to use:
- As root (or using sudo) add your user to the ‘fuse’ group:
# adduser butler fuse
Adding user `butler' to group `fuse' ...
Adding user butler to group fuse
Done. - Start a new shell as the desired user (to get the updated group list), make a mount point, and start sshfs. Note that sshfs will prompt you to accept the remote key (not shown) if this user hasn’t previously connected to this remote account.
$ mkdir soi
$ sshfs kevinbutler@soi.kd6.us:soi.kd6.us soi
kevinbutler@soi.kd6.us's password:
$ ls soi/images
changeDirectories.jpg keepRemoteSynced.jpg updatingFiles.jpg
directoriesSynced.jpg session.jpg watchForChanges.jpg
firstSession.jpg updateFiles.jpg
$ - Read and update files as if they were local - but with some transfer lag…
If you don’t want to deal with the lag every time you read or write the file, you’ll probably want to use scp or rsync to copy the files over when you need them on the remote machine - and you’ll probably want to use ssh-agent and ssh-add to set up key-based authentication, so you don’t have to type your password every time. You can even put the scp or rsync calls in your Makefile…
