Installation guide

Shfs stays for SHell File System. It consists of simple Linux kernel module (similar to smbfs, ftpfs or ncpfs) and userspace mount utility. The general usage:

$ shfsmount user@host /local/path
user@host password:
$ cd /local/path

Requirements

Client side:

Remote (server) side:

Installation

Installation should be straightforward. First, download sources (shfs-x.xx.tgz).

  1. unpack the tarball
    # tar -xzvf shfs-x.xx.tgz
    
  2. Check the top-level Makefile for KERNEL_SOURCES variable. It should contain path to your kernel directory (where include/linux resides).
  3. Important (kernel 2.4): check that your compiler is the same as used for compiling your kernel:
    # gcc --version
    2.96
    # cat /proc/version
    Linux version 2.4.18 (root@host) (gcc version 2.96 20000731 (Red Hat Linux 7.1 2.96-98))
    
    If these versions differ, check for your configuration, how to call the kernel compiler (e.g. gcc-3.2). You will have to pass this to make (make CC=gcc-3.2).
  4. make kernel module and shfsmount
    # make
    
    or (if you must specify the compiler):
    # make CC=compiler
    
  5. insert kernel module
    # insmod shfs/Linux-2.x/shfs.o
    
  6. mount remote filesystem, and test it
    # shfsmount/shfsmount user@hostname /mnt
    
  7. install shfs
    # make install
    
  8. if you don't like it [unlikely ;-)], wipe it out
    # make uninstall
    
  9. You can even make (debian/rpm) package and install it.
    # make deb
    # dpkg -i ../shfs*.deb
    
    or
    # make rpm
    # rpm -ivh ../shfs*.rpm
    
  10. There is also possibility to make a patch for kernel:
    # cd shfs/Linux-2.x/
    # make patch
    

    If the patch is applied, there is no need for kernel module, just shfsmount have to be build and installed.

Usage

The shfsmount command has number of options, please refer to the manpage for more detailed description.

shfsmount was designed to have the same interface as the mount command. make install should have created the symlink /sbin/mount.shfs -> shfsmount so you will be able to call

# mount -t shfs user@host /mnt

exactly as with other filesystems. You can even use automounter to connect to server automatically (think about using ssh keys).

If you would like all users to be able to mount remote dirs using shfs, set suid bit on /usr/bin/shfsmount. Security checks are similar to smbmount(8).