Friday, September 9, 2011

Mounting remote file system using sshfs

sshfs is a tool which mounts remote file system on local machine. It internally uses SSH file transfer protocol. The current implementation of sshfs has dependcny on fuse.

following packages are required to be installed:
sshfs
fuse (fuse-utils on some Linux distros)

On my open suse, fuse package was pre-installed and I needed to install sshfs.

the fuse kernel module has to be loaded before using sshfs. Here is the command to do that
modprobe fuse

I did not require anything to do anything for this on my open suse box because the fuse module was already loaded. This can be easily checked whether a particular module is already loaded or not using lsmod command.

Command to mount remote file system:
sshfs remote-user@remote-server:/remote/directory local-mount-directory