Wednesday, December 20, 2006

another filesystem sshfs

Although I don't know enough about file systems to say how secure this is. But since its running on ssh, I am assuming its secure enough for my humble earthly file sharing. So I found sshfs while looking for alternative for smbfs as it really was giving me quite a bit of problems. Here are the steps involved in getting it working.

Firstly, it only needs to be installed on the guest system. i.e the system where you are going to mount to.

You will need the following packages.
fuse-2.6.1.tar.gz (if your OS is not compiled with fusefs support)
sshfs-fuse-1.7.tar.gz

Just the standard should do.

./configure
make
sudo make install


Once the above two packages are compiled and installed, we now need to set up the system. Follow the steps below:

First you need to load the fuse module into the system.

sudo modprobe fuse
lsmod should show you fuse to be loaded.

fuse creates a device /dev/fuse on the system. Change the permissions on this device to allow read/write/execute as you see fit.
sudo chmod user:group /dev/fuse


Now you can create a local directory where the host OS will be mounted. I keep my smb mounts and sshmounts in /SHARES

mkdir /SHARES/hostname

Now you can mount the host system using sshfs

$sshfs -h
usage: sshfs [user@]host:[dir] mountpoint [options]

sshfs rohan@gandalf:~/sources /SHARES/gandalf


I would suggest to take a look at sshfs -h. It has a lot of options that can be configured.


Note: I had the error below when I tried to run sshfs
   foofs: error while loading shared libraries: libfuse.so.2:
cannot open shared object file: No such file or directory
I found the solution
"check /etc/ld.so.conf for a line containing '/usr/local/lib'. If it's missing, add it, and run ldconfig afterwards." at
fusefaq

No comments: