Whenever you need to securely copy files from one Linux system to another, you use tools like scp, sftp or rsync. But what if you don't want to copy the files to your local disk before using them? You would normally have to setup a network filesystem, such as NFS, OpenAFS or Samba. Unfortunately, setting either of these network filesystems requires administrator access on both system, something you don't always have access to. So what do you do then? It's simple: you install FUSE and SSHFS. SSH (Secure Shell) is one of the most used programs on a *nix system for at least two reasons. On one hand, an SSH connection is always secured, while on the other hand, it offers a long list of uses, from controlling a Linux system remotely, to what this article is about, mounting remote directories.
Installing
- First of all, you'll have to make sure your system has SSH client and server installed and correctly configured (these are parts of most, if not all, Linux distributions).
- To be able to mount remote directories, your system has to have installed a package that offers that support (SSHFS). This package is available for most modern and popular distributions, in their repositories but unfortunately, its name varies. To install SSHFS on Fedora Core, log-in as root and type:
- To be able to mount remote directories, the local machine has to have the fuse kernel module loaded. It's possible that the service has already been started by the package manager but after a reboot, it might be stopped. First, check if the fuse module is loaded:
Mounting
- At this point, your system is able to mount remote directories. Just type:
Unmounting
To unmount the directory once your work is done, use the command: