Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,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 3.00 / 5
  You rated: 2 / 5 (5 votes cast)
 
[42,417 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 whoever 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 Jan 18, '07 07:59:06AM

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 Jan 18, '07 08:37:27AM
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 Jan 19, '07 08:31:16AM

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 Jan 18, '07 08:42:49AM

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 Jan 18, '07 11:07:46AM
Anyone had any luck getting gmailfs working yet?

[ Reply to This | # ]
GmailFS link
Authored by: ars on Jan 18, '07 05:49:37PM
Where is fusermount?
Authored by: caek on Jan 18, '07 12:44:06PM

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 Jan 19, '07 10:32:26AM

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 Jan 18, '07 01:36:17PM

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 Jan 18, '07 05:16:56PM

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 Jan 18, '07 06:34:33PM

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 Jan 18, '07 07:53:21PM

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 Jan 19, '07 01:59:10AM

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 Jan 19, '07 02:25:10AM

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 Jan 19, '07 03:42:36AM

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 Jan 19, '07 10:04:30AM

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 Jan 19, '07 11:16:14AM
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 Jan 20, '07 09:16:40AM

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 Jan 20, '07 01:02:17PM

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 Feb 07, '07 02:14:26PM