SHFS stays for SHell File System. It is a simple Linux kernel module partially based on Florin Malita's ftpfs. Using this module, you can connect remote filesystems into your local filesystem tree.
$ shfsmount user@host /local/path user@host password: $ cd /local/path
With some quirks you can even use automounter and access your remote data just like the local ones. Imagine:
# ssh-agent # cd /shfs/user%host # ls -l drwx--x--x 7 user group 4096 May 17 15:26 WWW drwx------ 5 user group 4096 May 29 18:27 bin drwx------ 3 user group 4096 May 31 16:11 mail drwxr-xr-x 5 user group 4096 Apr 13 12:02 src
Just like NFS or ftpfs, but in a secure and wide-compatible way.
To say the truth, it is our work for Operating Systems course at Charles University. It is a hack, as all user space filesystems are, but works.
Installation should be straightforward. First, download sources (shfs-x.xx.tgz).
# tar -xzvf shfs-x.xx.tgz
# 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).
# makeor (if you must specify the compiler):
# make CC=compiler
# insmod shfs/shfs.o
# shfsmount/shfsmount user@hostname /mnt
# make install
# make uninstall
# make deb # dpkg -i ../shfs*.debor
# make rpm # rpm -ivh ../shfs*.rpm
The shfsmount command has a number of options. You have seen the simplest form in the
Installation section above.
Please refer to manpage
for the other options.
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 /mntexactly 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 and /usr/bin/shfsumount. Security checks are similar to smbmount.
Generic shell file operations (currently used on all systems except Linux) use very slow write command. For more info on this topic see internal docs.