I had read about sshfs in some magazine but hadn't got around to trying it out. A comment here (see comments at Fugu SSH/SFTP Client) triggered me to get off my butt and give it a spin.
You'll find sshf at http://fuse.sourceforge.net/sshfs.html. It requires FUSE, the user space file system. By the way, there are all kinds of other things built upon FUSE; you may want to poke around there.
Some small things that may need clarification:
The home page for sshfs says "This is a filesystem client based on the SSH File Transfer Protocol". True enough, but also it specifically depends upon sftp being enabled on the host you want to connect to. You'll find that in /etc/ssh/sshd_config (on the host you want to mount):
Subsystem sftp /usr/libexec/openssh/sftp-server
If that's commented out, uncomment it and do "kill -1 `cat /var/run/sshd.pid`"
Fuse needs /dev/fuse, which you can create with "sudo mknod -m 666 /dev/fuse c 10 229". If you run into problems with sshfs, /dev/fuse may not have rw permissions after you get done killing everything off, so you may need to sudo chmod it again.
Using sshfs looks something like this:
sshfs [email protected]: local_directory
If you don't want user's home directory as your root, say so:
sshfs [email protected]:/somedirectory local_directory
The FAQ implies that this can't handle symbolic links. In fact it can (this was done on a sshfs mounted Linux system):
$ ls -ld macstuff
lrwxrwxrwx 1 sam sam 5 Jul 13 07:57 macstuff -> ibook
$ cd macstuff
$ pwd -P
$ pwd -L
But (and it's an important but), this apparently actually depends on the remote sftp, and strangely it's not as simple as whether or not sftp at the other end comprehends symbolic links.
The "other end" is quite important to your success with sshfs. For example, I connected to an older BSD system here. Sshfs couldn't traverse symbolic links (though sftp to the same system could) and it would hang dead if I attempted an "ls". However, I could work with files, and cd to any ordinary directory. Any "ls" would lock it up solid, though. A 'fusermount -uz' from another window would unmount it, but I had to reboot to get everything happy again.
When talking to a more up to date ssh, sshfs is crisp and boring unless something interferes with your connection. If that happens, 'fusermount -uz mountpoint" is necessary.
Other than basic failure to communicate or talking to an older sftp server, problems are likely to be in FUSE - keep that in mind when researching: chances are you are looking for an underlying FUSE issue rather than a specific sshfs problem.
If you found something useful today, please consider a small donation.
Got something to add? Send me email.
More Articles by Anthony Lawrence © 2011-03-08 Anthony Lawrence