Shfs

From ArchWiki
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

Gnome-colors-add-files-to-archive.pngThis article is being considered for archiving.Gnome-colors-add-files-to-archive.png

Reason: shfs is probably not relevant anymore (Discuss in Talk:Shfs)

Shfs is a simple and easy to use Linux kernel module which allows you to mount remote filesystems using a plain shell (ssh) connection. When using shfs, you can access all remote files just like the local ones, only the access is governed through the transport security of ssh.

Note: The FUSE-based SSHFS is much more widely used, as shfs has not been updated since 2004.

Installation

Install the shfs-utils package.

Warning: In order to use shfs it needs to be installed and configured on the client side, not on the server side, server only needs to have working sshd running.

Configuration

Tango-inaccurate.pngThe factual accuracy of this article or section is disputed.Tango-inaccurate.png

Reason: Do not simply recommend setting the SUID bit on a binary since this can have severe security implications (Discuss in Talk:Shfs)

If you want to use shfsmount as mortal user, you will have to chmod +s /usr/bin/shfsmount and chmod + /usr/bin/shfsumount. However it is much more comfortable to put your mount options into /etc/fstab. For example:

remoteuser@Server:/data   /mnt/data   shfs    rw,noauto,uid=localuser,persistent   0       0
remoteuser@Server:/crap   /mnt/crap   shfs    rw,noauto,uid=localuser,persistent   0       0
remoteuser@Server:/backup /mnt/backup shfs    rw,noauto,uid=localuser,persistent   0       0
remoteuser@Server:/home   /mnt/home   shfs    rw,noauto,uid=localuser,persistent   0       0

You can Using SSH Keys to not type a password.

Maybe you need to complete your option list with port=<portnumber>.

Add an entry in fstab

To add an entry for an shfs volume in your fstab, add a line of the format:

userid@remoteMachine:/remoteDirectory /home/userid/remoteDirectory shfs rw,user,noauto 0 0

See also