Skip to main content

SSH filesystem

SSH Filesystem

Another way to get at files on remote hosts? The SSH Fuse filesystem. This effectively mounts remote filesystems using SSH. It's a bit complicated, but not bad. Here's how we do it (it's easier after the first time):

  1. Make sure you have the sshfs and FUSE packages installed. If you install sshfs on Ubuntu, for instance, it should pull in the necessary packages.
  2. Make sure that the fuse module is loaded. Check using lsmod | grep fuse and if it isn't loaded, run sudo modprobe fuse.
  3. Make sure you're in the fuse group. May require a log out and in again. (adduser username fuse or just append your username to the fuse line in /etc/group.)
  4. Now, make sure you have a directory to serve as a local mount point. I usually just use the server name. So I might make a local directory under my home directory called "kang" for a remote server called kang.zonker.net.
  5. To mount the remote filesystem, run: sshfs hostname:/directory localdirectory. For example, I might run: sshfs jzb@kang.zonker.net:/home/jzb/ kang .

That's it. Now you can browse the remote filesystem as if it were local. Naturally, like copying files over SFTP or scp, it's going to be slower. But this makes remote file management dead easy.