- 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:
# yum install fuse-sshfs
To install SSHFS on Ubuntu, type:
$ sudo apt-get install sshfs
It's possible that several packages required by sshfs will be installed as well. This is perfectly normal so don't worry.
- 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:
# lsmod | grep fuse
If you don't get any message at all, the fuse module isn't loaded so you'll have to execute:
- On Fedora:
# service fuse start
- On Ubuntu:
$ sudo modprobe fuse
- Moreover, you might want to have the fuse module auto-loaded every time your system boots.
# echo "service fuse start" >> /etc/rc.local
$ sudo sh -c "echo fuse >> /etc/modules"
- Finally, the Unix user you're currently using has to be added to group fuse.
on Fedora, type:
$ su -c 'gpasswd -a your-username fuse'
on Ubuntu, type:
$ sudo adduser your-username fuse
- At this point, your system is able to mount remote directories. Just type:
$ sshfs user@hostname:/path/to/remote/folder/ /path/to/local/folder/
- If it doesn't return any errors, you should be able to browse through /path/to/local/folder/ and manage files located there.
To unmount the directory once your work is done, use the command:
$ fusermount -u /path/to/local/folder/
NOTE!: Make sure your current working directory isn't the one remotely mounted or the unmount command won't work. First, change directory (cd ...) to another dir and execute that command.