Difference between revisions of "Shfs"

From ArchWiki
Jump to: navigation, search
m (Installation)
m (changed structure a bit)
Line 16: Line 16:
 
Yet, consider: the only thing you need on the server is a sshd running - and you can mount your from '''ANYWHERE''' in a '''secure''' way.
 
Yet, consider: the only thing you need on the server is a sshd running - and you can mount your from '''ANYWHERE''' in a '''secure''' way.
 
==Howto SHFS==
 
==Howto SHFS==
=Installation=
+
===Installation===
 
If you have a Standard Arch-kernel installed, you can simply
 
If you have a Standard Arch-kernel installed, you can simply
 
<pre>pacman -Sy shfs</pre>providing you have configured [[pacman]] to use the [[ArchLinux User-community Repository (AUR)|community repository]].
 
<pre>pacman -Sy shfs</pre>providing you have configured [[pacman]] to use the [[ArchLinux User-community Repository (AUR)|community repository]].
Line 24: Line 24:
 
su -c '*.pkg.tar.gz'</pre>.
 
su -c '*.pkg.tar.gz'</pre>.
  
=Configuration=
+
===Configuration===
 
If you want to use shfsmount as mortal user, you will have to <code>chmod +s /usr/bin/shfsmount</code> and <code>chmod + /usr/bin/shfsumount</code>. However it's much more comfortable to put your mount options into <code>/etc/fstab</code> - this is what mine looks like:<pre>remoteuser@Server:/data  /mnt/data  shfs    rw,noauto,uid=localuser,persistent  0      0
 
If you want to use shfsmount as mortal user, you will have to <code>chmod +s /usr/bin/shfsmount</code> and <code>chmod + /usr/bin/shfsumount</code>. However it's much more comfortable to put your mount options into <code>/etc/fstab</code> - this is what mine looks like:<pre>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:/crap  /mnt/crap  shfs    rw,noauto,uid=localuser,persistent  0      0
Line 31: Line 31:
 
Btw, if you are a paranoid bastard, like I am, and do not run ssh on port 22 on your server, you will need to complete your option list with <code>port=<portnumber></code>.
 
Btw, if you are a paranoid bastard, like I am, and do not run ssh on port 22 on your server, you will need to complete your option list with <code>port=<portnumber></code>.
  
=/etc/fstab=
+
===/etc/fstab===
 
To add an entry for an shfs volume in your fstab, add a line of the format: <CODE>userid@remoteMachine:/remoteDirectory /home/userid/remoteDirectory shfs rw,user,noauto 0 0 </CODE>(came from [http://ubuntuforums.org/archive/index.php/t-30332.html Ubuntu Forums]).
 
To add an entry for an shfs volume in your fstab, add a line of the format: <CODE>userid@remoteMachine:/remoteDirectory /home/userid/remoteDirectory shfs rw,user,noauto 0 0 </CODE>(came from [http://ubuntuforums.org/archive/index.php/t-30332.html Ubuntu Forums]).
  

Revision as of 15:52, 26 November 2005

What is 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.

Why SHFS?

Shfs supports some nice features:

  • 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)

If these features can't convince you, I probably can't either.
Yet, consider: the only thing you need on the server is a sshd running - and you can mount your from ANYWHERE in a secure way.

Howto SHFS

Installation

If you have a Standard Arch-kernel installed, you can simply

pacman -Sy shfs
providing you have configured pacman to use the community repository. If you run a self-baked Kernel, you can install shfs from ABS
cd /var/abs/community/system/shfs
makepkg
su -c '*.pkg.tar.gz'
.

Configuration

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's much more comfortable to put your mount options into /etc/fstab - this is what mine looks like:
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
Soon you will get tired typing passwords and once you do, you might consider Using_SSH_Keys.

Btw, if you are a paranoid bastard, like I am, and do not run ssh on port 22 on your server, you will need to complete your option list with port=<portnumber>.

/etc/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 (came from Ubuntu Forums).


External Links

http://shfs.sourceforge.net/ for a supposed to be complete reference.
http://www.openssh.com/ for a really complete reference ;)