[CS-FSLUG] To SHFS or SSHFS...

David Aikema daikema at gmail.com
Thu Oct 20 01:25:53 CDT 2005


On 10/19/05, Don Parris <evangelinux at matheteuo.org> wrote:
> SHFS and SSHFS are two projects that could replace NFS as a secure network
> filesystem in our proposed LS3.  However, what are the the advantages of each?

What's an LS3?

> Here is the SHFS project:
> http://shfs.sourceforge.net/
>
> and the SSHFS project:
> http://fuse.sourceforge.net/sshfs.html
>
> O.k., here is my *limited* understanding so far.
>
> SHFS is simply a kernel module, like smbfs, with a userspace mount utility
> (quoted almost verbatim from the project's web site).
> # file cache for access speedup
> # perl and shell code for the remote (server) side
> # could preserve uid/gid (root connection)
> # number of remote host platforms (Linux, Solaris, Cygwin, ...)
> # Linux kernel 2.4.10+ and 2.6
> # arbitrary command used for connection (instead of ssh)
> # persistent connection (reconnect after ssh dies)
>
>
>
> SSHFS, on the other hand, makes use of the FUSE filesystem and SSH to
> accomplish the task.  Apparently, it's fairly simple to use.
>
>      *  Based on FUSE (the best userspace filesystem framework for linux ;-)
>      * Multithreading: more than one request can be on it's way to the server
>      * Allowing large reads (max 64k)
>      * Caching directory contents
>
>
> Based on what I can see, SHFS appears to be more mature/robust than SSHFS.

To me it's SSHFS that seems a little more mature than SHFS ... the
latter speaks of "perl and shell code for the remote (server) side" so
it seems that it's a little more complicated to setup (and if the code
is running as root on the opposite end, potentially less secure). 
Additionally, the website for the latter also notes that "the code was
originally developed as an assignment for an Operating Systems course
at the Charles University, Prague," and you can take that however you
wish.

> SHFS can make root connections, while SSHFS suggests running as user, not
> root.  I assume that means it's best not to make connections as root.
> Someone else may have a sense of whether this is an advantage or
> disadvantage.

It's potentially more hazardous to run things as root.  However, there
is the advantage mentioned of being able to maintain file ownership. 
When a process is running as root, if well coded, it may be dropping
root privileges when it doesn't need them through the usage of the
setuid function, and this wuold limit the security risk somewhat.  (At
the moment I'm simply too tired and/or lazy to check the source of
shfs to confirm this though).

I'm not really familiar with user-space file systems under Linux,
though, so I can't really say much about FUSE and whether or not it's
any good.

David




More information about the Christiansource mailing list