sshfs

OpenSSH is a suite of tools that allows (among other things) secure encrypted remote logins. I frequently use it to shell into the machine that hosts this blog. I recently learned of the SSHFS project, which allows one to mount a remote filesystem locally via ssh.

I primarily blog from my Powerbook via wireless, but I have an old Dell box running Ubuntu linux upstairs. I thought it might be nice to install SSHFS on it, for those occasions calling for a bigger monitor and some extended emacs work. The install instructions for SSHFS and the prerequisite FUSE are simple enough, and the installs seemed to go well. When I tried to use sshfs, it did not work:

[pwyll@ginger ~]$ sshfs pwyll@bidwell.textdrive.com: ~/bidwell
sshfs: error while loading shared libraries: libfuse.so.2: cannot open shared object file: No such file or directory

The file did indeed exist:
[pwyll@ginger ~]$ locate libfuse.so.2
/usr/local/lib/libfuse.so.2.3.0
/usr/local/lib/libfuse.so.2

I wrote to the author of SSHFS, Miklos Szeredi, and explained the situation in some detail, including a transcript of the install console session. He was kind enough to reply, and asked “Do you have /usr/local/lib in /etc/ld.so.conf?”.

I did not, so I put it in. Still no luck. I googled the string “/etc/ld.so.conf sshfs” and found a discussion that suggested I might need to run ldconfig. I did so, and everything finally worked.

I have no idea how people ever got this stuff to work before google. I post these remarks on the off chance they may help someone else googling for SSHFS install help. And much thanks to Miklos Szeredi, whose SSHFS is extremely cool.

Sometime afterwards I saw that there is a Debian package for SSHFS. I probably could just have used apt-get install and saved myself some trouble.

13 Responses to “sshfs”

  1. Thank you for your help. You leaving this comment saved me a lot of time!

  2. Just want to add that *even if your don’t have libfuse.so.2.3.0 on your system* (as I didn’t, after installing fuse) adding the line /usr/local/lib in /etc/ld.so.conf will solve the problem, once you add the line and run ldconfig again.

  3. It helped. Thank you!

  4. Your off-chance remarks worked for me too… Thanks very much for the pointer!

  5. To all concerned, I am delighted to have helped even a little. Countless other people have helped me through their articles and postings. It is gratifying to return the favor.

  6. Hi, I am trying to build fuse/sshfs on my OSX 10.4.6 machine but for now, no luck … Problems with
    ../include/fuse_compat.h:12:24: error: sys/statfs.h: No such file or directory
    I tried to put the osx alternatives in but still no luck …
    Do you have any suggestions ?

  7. Not really. I’ve never even tried to build sshfs on OSX; I just use my Mac as a terminal to connect to my linux box. And I’m not hardcore enough to break any ground here. I was lucky to get sshfs working on Ubuntu.

    I once googled around for sshfs on OSX, but with no luck. If you succeed, please make an effort to put your approach online somewhere. I think many people would be interested.

  8. I had assumed that it would be a snap to compile sshfs on OS X and was planning to do so. Bit of a shock that other people have not been able to get it to work. I am having terrible problems with sharing network home folders using OS X Server 10.4 (afp) and was thinking that sshfs would be a perfect solution.

    I would also like to know if someone has successful compiled and used sshfs on Mac OS X 10.4

  9. I doubt that it is possible to port SSHFS easily to OSX as it is based on FUSE which is a linux kernel module.

    The lack of ext3 and ssh-mounting options for OSX is really a showstopper for me trying to get some work done from a mac.

  10. This article helped a lot. I was trying to install other fs built on fuse. Thanks!

  11. SSHFS client is already ported to FreeBSD, so a port to Mac OSX must be possible

  12. [...] Some time ago I posted some remarks on my adventures getting sshfs to work on Unbuntu linux. It was fairly obscure stuff, but I got a lot (by this blog’s standards) of comments, and several asked whether I knew how to get sshfs to work on a Mac. I did not, nor seemingly did anyone else. But the Google Mac team has announced a release of FUSE (File System in User Space) for the Mac. This finally makes it possible (among many cool things) to run sshfs on a Mac. A happy day indeed for Mac geeks. I plan to wait a week or so before checking it out, to let others file down the rough edges. softwareShare and Enjoy:These icons link to social bookmarking sites where readers can share and discover new web pages. [...]

  13. This worked for me too! THANK YOU… and thanks Google for letting me find you :-)