sshfs – Remote filesystem access made easy

If you often need to access files on a remote machine and do it by ssh login, there is a handy way – sshfs. Here is a simplified howto that works.

(1) Set up the rpmforge repository if not done yet (see Installing RPMForge )
(2) Either use the dkms-fuse with the stock RHEL/CentOS kernel or use the centosplus kernel that contains the fuse kernel module.

[Note 1: fuse is included in the kernel as of RHEL/CentOS/SL 5.4]
[Note 2: In RHEL/CentOS/SL 6, start with step (4)]

[root@mybox ~]# yum install dkms-fuse && modprobe fuse

(3) Also install the fuse libraries:

[root@mybox ~]# yum install fuse

(4) Then install the fuse-ssh filesystem:

[root@mybox ~]# yum install fuse-sshfs

(5) Add yourself to the group ‘fuse’:

[root@mybox ~]# usermod -a -G fuse user1

(6) Re-logon to your account
(7) Create a local directory:

[user1@mybox ~]$ mkdir remotedir/

(8) To mount (remote username=usr2):

[user1@mybox ~]$ sshfs user2@machine.example.com: remotedir/

(9) To unmount:

[user1@mybox ~]$ fusermount -u remotedir

One thought on “sshfs – Remote filesystem access made easy

Comments are closed.