Home > Tips and tricks > Secure remote folders with fuse and sshfs

Secure remote folders with fuse and sshfs

Install the SSH filesystem rpm called sshfs:


[root@server ~]# yum install sshfs

Now add the users to the fuse group that are allowed to use this neat trick. In this example I’ll add myself to the fuse group:


[root@server ~]# usermod -G fuse patrick

Load the fuse module:


[root@server ~]# modprobe -v fuse

Make the directory where you want to mount the remore folder using sshfs:


[root@server ~]# mkdir /home/patrick/remotefolder

Mount the remotefolder:


[root@server ~]# sshfs me@server:/localfolder /home/patrick/remotefolder

You can now work transparantly in the /home/patrick/remotefolder. When you are done and want to unmount the folder all you need to do is:


[root@server ~]# fusermount -u /home/patrick/remotefolder

You can also add the remotefolder to /etc/fstab:


sshfs#me@server:/localfolder /home/patrick/remote_folder/ fuse defaults,noauto 0 0

The fuse module should be loaded automagically. If it doesn’t load it manually with:


[root@server ~]# modprobe -v fuse
Categories: Tips and tricks Tags:
  1. No comments yet.
  1. No trackbacks yet.