hubertf's NetBSD Blog
Send interesting links to hubert at feyrer dot de!
 
[20061123] ssshfs success (Updated)
I've taken the existance of ssshfs as a reason for upgrading my kernel from the netbsd-4 branch (which will go through re-birth from -current soon anyways) to today's -current, and played with ssshfs a bit. As I didn't want to upgrade the full userland of the machine, I had to do a bit of a dance to get things going in src/obj/destdir, but after
  • chroot .../src/obj/destdir
  • cd .../src/obj/destdir/dev ; sh MAKEDEV all puffs
  • cd .../src/share/examples/puffs/ssshfs ; make
  • ./ssshfs i@remotemachine:/path/to/my/home /mnt
things work fine, and I can access my $HOME on the remote machine just like a local file (esp. from outside the chroot):
miyu% df | grep destdir
puffs:ssshfs  0 0 0   100%    /usr/src/obj/destdir/mnt
miyu% cd /usr/src/obj/destdir/mnt
miyu% ls
AdobeFnt.lst    OS                  bin     public_html
Desktop         OpenOffice.org1.1.0 in      tmp
...
miyu% ls -l .cshrc
-rw-r--r--  1 39068  2000  4706 Jun 16 01:01 .cshrc
miyu% head -2 .cshrc
# Default .cshrc fuer Solaris, Irix, ...
#
miyu% md5 .cshrc
MD5 (.cshrc) = 2ad1d2606a5678f312709a388376c2e5
miyu% ls -l test
ls: test: No such file or directory
miyu% date >test
miyu% ls -l test
-rw-r--r--  1 39068  2000  29 Nov 23 01:19 test
miyu% cat test
Thu Nov 23 01:19:36 MET 2006
miyu% vi test
miyu% cat test
Thu Nov 23 01:19:36 MET 2006
foobar
hubertf was here
miyu% rm test
miyu% cat test
cat: test: No such file or directory
miyu% 
Neat! I've found one bug when running stat(2) -- e.g. via ls -l -- on a symlink. ssshfs then hangs and the mounting process needs to be ^Cd, but I'm sure this is not a major problem.

Update: The cause of the hang was identified: I tried this against Solaris 9, which has a sshd that only supports the SFTP File Transport Protocol Version2, but to properly handle symlinks Version 3 is needed. A check for the protocol version was added, to indicate the case can't be handled.

[Tags: , ]


Disclaimer: All opinion expressed here is purely my own. No responsibility is taken for anything.

Access count: 36038574
Copyright (c) Hubert Feyrer