Mount Remote File Systems Over SSH with SSHFS

If you work on remotely connected machines, most likely you’re going to use SSH to secure your connections. But, what if you just want to work with files on a remote server, but find SSH file transfer tedious in repetition and establishing a VPN tunnel is too complicated?

What you’re looking for is a simple tool for mounting remote file systems easily, transparently and securely as if they were just another part of your local machine. In this hack, we’ll show you how to configure Fuse and SSHFS to access remote file systems securely over SSH.

Fuse (File system in User-space) is a Linux kernel module that allows non-privileged users to create their own file systems without modifying the kernel. Fuse provides a bridge between user-space file system code and the actual kernel interface. SSH File System (SSHFS) is a file system client based on the Secure Shell protocol.

Step 1: Installing Fuse

If you don’t already have Fuse installed, grab the latest tarball from their web site. As of writing, the most current stable release available is 2.6.5. Open the tarball file and install Fuse by running the following commands:

After FUSE has finished building and you have installed it, we can move onto installing SSHFS.

Step 2: Install SSHFS

SSHFS works with FUSE to mount drivers over SSH. You can download the latest build from here. As of writing, the current stable release available is 1.8. Install it using the following commands:

Step 3: Mount your remote file system

Now that you have a working setup, you need to create a new mount point and mount the remote server file system using the SSHFS command. If everything goes well, the remote file system will be available as a regular mount file system.

As you can see, SSHFS is a powerful tool for sharing files across the Internet. Not only does it provide security, but it also provides a simple method accessing a remote host and its file systems.