You are here
Remote file access with sshfs
If you need to get access to files on a remote machine, but the filespace on that machine isn't normally visible from your local machine, you can often access it using the sshfs tool. On Debian/Ubuntu machines you will need to install the sshfs
package, on Redhat/Fedora machines the package is named fuse-sshfs
.
Here's an example. To make machine xyzzy
's directory /tmp
available locally you could do something like the following:
mkdir ~/localxyzzy sshfs xyzzy.inf.ed.ac.uk:/tmp ~/localxyzzy
To clean up afterwards you would type
fusermount -u ~/localxyzzy
For full details type man sshfs
.
There are a couple of points to note.
- It is not possible to mount onto directories in AFS (e.g. an Informatics home directory), this problem can be avoided by creating a directory in a local filesystem (e.g.
/disk/scratch
) and mounting onto that instead. - If your machine is outside of the Informatics wired network, or is on wireless, you will first need to connect securely into Informatics, using for instance a VPN or an ssh tunnel. (For an example of how to set up an ssh tunnel see the Using VNC page.)
- Also, be aware of the limitations of sshfs: it's useful for giving temporary access to one remote filesystem to one user on one machine. If you want more than that you might want to look for a different (less hacky) solution.
Last reviewed:
19/05/2021