MacFUSE & sshfs. Ok - this allows you to mount up (and view in finder) those file systems which you would otherwise only be able to access via SSH (either via the command line, or via some SCP/SFTP capable client, like Cyberduck or Fugu). Now you can drag/drop files, and interact with those files as if they were on a mounted local network drive, or an external hard disk.
Not only that, but it’s fully accessible though the command line as well, since it’s available through /Volumes/.
is the wrapper which installs the hooks so that these things appear like local filesystems, and sshfs is the type of filesystem we want to use here (there are others of course, but ssh is the one which really interests me at the moment). First things first then - grab MacFUSE and sshfs from the development site (it’s hosted / sponsored / developed by those nice Google people). Install the MacFUSE package first, reboot and then install sshfs (actually, sshfs is just an application which you can copy into your applications directory in the usual way). Running sshfs then pops up a window, allowing you to enter your host, username and default directory. As it connects it will prompt you for a password (if required), and then if it’s successful, it will mount it up into the finder.
I have to admit, I’ve been using Cyberduck for a while - I like it’s simplicity (and it’s FTP & SFTP capable), I don’t like it’s tendency to bail out during large file transfers, so I have been looking for something else to take it’s place for a while. This might fit the bill nicely, since it also enables me to do something else I’ve been wanting to do for a while - use subversion to update files straight onto the server, without an intermediate stage and manual intervention.
I’m a command line hacker when it comes to SVN. I also use SvnX (which is good when it comes to viewing the repository on the server), so having the remote files available in the filesystem means that I can do something like this :
svn commit –username me -c “Very important updates for luckymonkey”
cd /Volumes/www.remoteserver.com/path/to/site
svn up
and watch the files go automagically - very cool. (Of course, you’d probably tag the release before you put it into production..)
However, it didn’t work the first time - there is a little more configuration you have to do (since POSIX move and SVN move are ever so slightly different things..). It does mean that you can’t mount up a filesystem you want to use for SVN from the GUI utility, but you can knock up a shell-script to do it for you instead (which is not such a bad thing). The magic incarnation goes something like this. With the filesystem unmounted :
1. You’ll need to link to the binary which is within the application package so that you can get to it easily from the command line. This will ask you for your administrator password to create the link
sudo ln -s /Applications/sshfs.app/Contents/Resources/sshfs-static /bin/sshfs
2. Create the directory to mount into
mkdir /Volumes/www.whatever.com/
3. Mount up the remote filesystem
sshfs username@host:/<default-directory> /Volumes/www.whatever.com -o reconnect,ping_diskarb,workaround=rename,volname=www.whatever.com
4. Go ahead and checkout!
The workaround=rename is the magic bit as far as SVN is concerned. This does actually work - but, I have noticed some problems where . files have made their way into the repository (e.g. ._somefile.txt .someimage.jpg etc), which can cause the checkout to fail - so I’ve used SvnX at that point to go back in and clear out the repository of those pesky files.
I’ll continue to use this instead of Cyberduck from now on, so we shall see how it goes.
Via Lifehacker - although the SVN stuff is rather cobbled together from the MacFUSE wiki.
Added - The MacFUSE and sshfs binaries have been updated - the workaround=rename option is now enabled by default in sshfs v0.2.0.






2 Comments
That is pretty darn cool. I may use that for connecting to my home machines from work to transfer files.
I saw you mention svn, have you tried using the svn bundle of textmate. Its completely changed the way I develop sites. Everything from file creation to commiting can be done within textmate.
In a word - yes I have, it seemed to have a problem with the - in the name of the SVN server at the time I tried it, and SvnX allows me to browse the repository on the server, and I’m just quick with the command line, so those are my tools of choice for the moment. I’ll check it out again though and see if it’s changed (or I have)
Post a Comment