Pick of the Week - Nov 10 [Show all picks]
Path Finder 5 - A feature-laden Finder replacement
Submit Hint Search The Forums LinksStatsPollsFAQHeadlinesRSS
12,000 hints and counting!

10.4: How to create an SSH volume using FUSE UNIX
Amit Singh posted an entry on his blog that mentioned the MacFUSE project -- the implementation of FUSE for Mac OS X.

Using the references that he mentions, one can have one's SSH account appear as a directory -- making it easy to handle and manage. Here's how...

Steps:
  1. Download the MacFUSE binaries.
  2. Once downloaded, install with this command:
    sudo tar -C / -jxvpf fuse-binaries-0.1.0b006.tar.bz2
    Note that you might have to change the version number to match your download.
  3. Reboot, so that the new kernel extensions are loaded.
  4. Connect to one's SSH account using the sshfs command.
For example, say I want to mount the home directory on my dreamhost account, which has the domain name bottlecap.dreamhost.com. I would do it by executing the following command:
$ sshfs username@bottlecap.dreamhost.com: $PWD/dream
Remember that the dream directory must exist in your home folder and be owned by you, the user. To unmount the directory once your work is done, use this command:
$ fusermount -u
For example, in my case, I would use fusermount -u $PWD/dream

References: Thanks, Amit, for the tip -- much appreciated!

[robg adds: A variation on this tip was also submitted by yanokwa, who described the ssh mounting process in a bit more detail:

"To use mount a file system using sshfs, use this:
$ mkdir /some/mount/point
You can also use one that already exists, but not in /Volumes. To mount the SSH file system, use this:
 sshfs user@host:/some/directory /some/mount/point 
-oping_diskarb,volname=volname
There's a how-to wiki on the above-linked MacFUSE site if you need additional assistance. Note that I have not tested this one myself.]
    •    
  • Currently 0.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (0 votes cast)
 
[26,948 views]  

10.4: How to create an SSH volume using FUSE | 20 comments | Create New Account
Click here to return to the '10.4: How to create an SSH volume using FUSE' hint
The following comments are owned by whomever posted them. This site is not responsible for what they say.
10.4: How to create an SSH volume using FUSE
Authored by: Numbski on Thu, Jan 18 2007 at 7:59AM PST
I've downloaded this but not installed it yet. I need to.

There are a couple of things that need to be added to this tip that aren't there already (perhaps I can comment again later?).

1. How to set up passwordless ssh using shared keys (so your password does not need to be typed in).

2. Obviously there's a flag for diskarbitrationd so that finder can recognize it as a mounted volume. What's needed now is an automount method so that at login the volume gets mounted, and some management method so that if the network connection drops (such as on a laptop) it knows to attempt reconnection, etc.

Good stuff. :) Paired with a little filesystem syncronization magic, this could go the poor-man's roaming home directory solution. Finally.

[ Reply to This | # ]
10.4: How to create an SSH volume using FUSE
Authored by: yanokwa on Thu, Jan 18 2007 at 8:37AM PST
1. To create passwordless logins you can use this hint.

2. There is the "-o reconnect" flag for dropped connections and you could write a script that runs on startup/login to connect to the volume. I haven't personally tried any of these so YMMV.

[ Reply to This | # ]
10.4: How to create an SSH volume using FUSE
Authored by: Numbski on Fri, Jan 19 2007 at 8:31AM PST
Thanks, I know how to do passwordless ssh myself. Just thought a link on this hint would be useful. :)

The reconnect flag is sweet, thanks for that as well. I've gotta do a bit more poking around, but I like what I see so far. Only thing left is to use a synchonrization mechanization to replicate home directory changes at intervals and I'm set. ;)

[ Reply to This | # ]
10.4: How to create an SSH volume using FUSE
Authored by: koehn on Thu, Jan 18 2007 at 8:42AM PST
There's no need to reboot, the kernel will load the extensions when you first run sshfs.

[ Reply to This | # ]
10.4: How to create an SSH volume using FUSE
Authored by: simon_zen on Thu, Jan 18 2007 at 11:07AM PST
Anyone had any luck getting gmailfs working yet?

[ Reply to This | # ]
GmailFS link
Authored by: ars on Thu, Jan 18 2007 at 5:49PM PST
Where is fusermount?
Authored by: caek on Thu, Jan 18 2007 at 12:44PM PST
minion:Downloads$ sudo tar -C / -jpxvf fuse-binaries-0.1.0b006.tar.bz2
minion:Downloads$ sshfs server: ~/server
kextload: /System/Library/Extensions/fusefs.kext loaded successfully
minion:tplinux16$ fusermount -u server
-bash: fusermount: command not found
minion:tplinux16$ cd ..
minion:mike$ which sshfs
/usr/local/bin/sshfs
minion:mike$ ls /usr/local/bin/
[no fusermount!]

[ Reply to This | # ]
Where is fusermount?
Authored by: SeanAhern on Fri, Jan 19 2007 at 10:32AM PST
Just use normal "umount" to unmount the filesystem.

[ Reply to This | # ]
10.4: How to create an SSH volume using FUSE
Authored by: dnchayes on Thu, Jan 18 2007 at 1:36PM PST
Very handy, thanks!

When I followed the link to install, I found a "dmg" file ( MacFUSE-0.1.0b006.dmg) which I used instead of the tarfile.

This did not install the "fusermount" (as shown in the original example) however, the normal command "umount" worked.

%umount /Users/dale/bumpf

Note that the short hand of $PWD/bumpf is a bashism. If you use tcsh or csh, this short hand won't work.


[ Reply to This | # ]
10.4: How to create an SSH volume using FUSE
Authored by: ars on Thu, Jan 18 2007 at 5:16PM PST
I can mount this way a Unix directory, but when I doubleclick on a text file I get garbage showing in the file! Any suggestion what the problem might be?

[ Reply to This | # ]
10.4: How to create an SSH volume using FUSE
Authored by: oliverlangan on Thu, Jan 18 2007 at 6:34PM PST
I left an ssh volume mounted when I left for work today, and on returning noticed that it had caused my daily SuperDuper! backup to fail. The only workaround I can think of to this would be to create the mount points outside of the boot disk's filesystem (on a secondary disk, ideally).


[ Reply to This | # ]
10.4: How to create an SSH volume using FUSE
Authored by: jhirbour on Thu, Jan 18 2007 at 7:53PM PST
This is an AWESOME hint!!!! It worked almost flawlessly, except symlinks on the remote system don't work. The symlinks end up pointing to spots on my local file system rather than /var/www on my server... :-(

Hopefully apple will integrate this into the next version of OS X. so you can just do Go->Connect to server->scp://username@host or ssh://username@host....

we'll see.

[ Reply to This | # ]
10.4: How to create an SSH volume using FUSE
Authored by: ravioli on Fri, Jan 19 2007 at 1:59AM PST
About symlinks, I had the same problem.
The option "-o follow_symlinks" (follow symlinks on the server) should do the trick.
At least, it worked for me.


[ Reply to This | # ]
10.4: How to create an SSH volume using FUSE
Authored by: monmayrant on Fri, Jan 19 2007 at 2:25AM PST
It's really handy and everything works fine for me, even mounting/unmounting from the Finder.
Only trouble: it doesn't seem to handle non-ascii characters in the paths (é à ü, ...) and paths like:
~/Documents/Thèses/Rapport de Noël.pdf
are mangled:
~/Documents/Th?/Rapport de No?.pdf

Did anyone notice the same problem?
Any solution?

BoZ

[ Reply to This | # ]
10.4: How to create an SSH volume using FUSE
Authored by: mr.quinn on Fri, Jan 19 2007 at 3:42AM PST
I was playing with this yesterday.
I managed to mount an Ubuntu box into the Finder via sshfs successfully.
I then tried to backup the contents of /usr/local/svn on the Ubuntu box to Amazon's S3 service, using JungleDisk on the Mac.
OK, so it may seem like a daft thing to do, but I wanted to stress-test this all, and it did stress it, the sshfs connection crashed after a while, needing a log out to reset it.
MacFUSE is going to be great, I look forward to flickrfs, s3fs, gdrivefs etc etc. but be warned, it is not terribly robust yet.

[ Reply to This | # ]
Timeout issue?
Authored by: Lectrick on Fri, Jan 19 2007 at 10:04AM PST
I was delighted with sshfs, as it were, until I left the "volume" connected for a while with no activity (I'm behind a firewall at work, if that matters), and when I next tried to access something I got the Happy Beachball of Deathâ„¢.

Still needs work?

---
In /dev/null, no one can hear you scream

[ Reply to This | # ]
10.4: How to create an SSH volume using FUSE
Authored by: Eryximakos on Fri, Jan 19 2007 at 11:16AM PST
Take a look at this page: http://mac.pqrs.org/sshfs/

[ Reply to This | # ]
10.4: How to create an SSH volume using FUSE
Authored by: abobrow on Sat, Jan 20 2007 at 9:16AM PST
naive question: Is this better/faster/safer than using WebDAV? I have a Dreamhost account which allows me WebDAV and SSH. I like the idea of mounting that server for backups, but is there a reason I should mess with this (other than it would be cool)?

[ Reply to This | # ]
10.4: How to create an SSH volume using FUSE
Authored by: danielj7 on Sat, Jan 20 2007 at 1:02PM PST

FUSE is now available from Fink as well. You need to enable the unstable tree to install them.

Currently available filesystems are curlftpfs, sshfs, and gmailfs in both Python 2.4 and Python 2.5 flavors.

You don't need to explicitly install fuse; fink takes care of that for you. Just fink install sshfs, for example, and you're set.



[ Reply to This | # ]
10.4: How to create an SSH volume using FUSE
Authored by: jauty on Wed, Feb 7 2007 at 2:14PM PST