This is a nice trick I use to get my /home/Public of my NAS at home directly as a mounted volume on my MacOS X desktop.
You need to install three applications / frameworks:
1. MacFuse
2. Macfusion
3. sshfs (to update the old version pre-installed with Macfusion)
1. Install MacFuse
Download and install MacFuse.
MacFuse comes with a nice preference pane to check for updates. The version was 2.0.3 (or 2.1.5 beta) as of this writing.
2. Install Macfusion
Macfusion is an open source SSHFS mounting application for OSX (Snow) Leopard. Download and install.
If you’re using Snow Leopard, you’ll find that the current version of MacFusion refuses to complete a connection to a remote server. You can fix this in three steps:
1. First, quit MacFusion.
2. Second, open System Preferences and then open the MacFUSE pane. Check the “Show Beta Versions” box and click “Check For Updates”. Go ahead and update MacFUSE to version 2.1.5 beta as of this writing.
3. Third, open up a terminal and do the following:
rm /Applications/Macfusion.app/Contents/PlugIns/
sshfs.mfplugin/Contents/Resources/sshnodelay.so
Your MacFusion installation should now be working on Snow Leopard.
Add an SSHFS file system
To add an SSHFS file system click on the plus icon at the bottom of the main window and choose SSHFS.
Adding an SSHFS filesystem
Set SSHFS mount parameters
Under the SSH tab:
Host: The hostname of the server that you SSH to. This is usually the domain name of you website ( e.g. ‘yourdomain.com’ ).
User Name: Your SSH username.
Password: Your SSH password.
Path: can be left blank, default path will be used
Under the SSH Advanced tab:
Port: The default SSH port is 22 unless your server uses a different one ( just try 22 ).
Follow Symbolic Links: Leave this checked.
Under the Macfusion tab:
Mount Point: can be left blank.
Volume Name: can be left blank, but to nice up the icon on your desktop, use any name
Ignore Apple Double Files: You must uncheck this if you plan to open/edit/save files on the mounted volume. For example, if you want to edit an image file using Photoshop, this setting has to be unchecked. However, this powerful feature comes with a downside. Leaving this unchecked will cause OSX to place .DS_Store and ._ * ( Appledouble ) files on the server. OSX utilizes these hidden files for enhanced filesystem features and extended file attributes in non OSX native filesystems. For example, a Photoshop file can have icon, thumbnail, and version cue information saved in a separate Appledouble file. These files are invisible in OSX and other filesystems as they start with a dot. Leave this checked if you are just going to copy/move/delete files ( increases speed ). You can leave this checked if editing text files as most apps don’t save additional file attributes with text files. However, this depends on the application you use, so do some testing first.
Enable Negative VNode Cache: This is an optimization to increase speed and should generally be left checked unless files can appear on the mounted volume from the server side. For example, if multiple users are using your mounted disk space leave this unchecked.
You will now have an SSHFS filesystem ready to mount on your desktop.
Mount the remote filesystem
Click on the mount button and if the SSH settings are correct, you should have a green disk icon mounted on the desktop.
You can now access your remote files like they were on an external disk attached to your computer. You can copy, move, rename and delete files at ease. Remember that if you want to edit files on the remotely mounted disk, the Ignore Apple Double Files checkbox should be unchecked. You can easily edit the SSHFS mount settings by unmounting the disk and clicking on the Edit button.
You might have noticed that we completed only two of the three steps but you can already mount your remote filesystem. This is because Macfusion already has SSHFS pre-installed within its application package. However, I found the mounted filesystem response to be a little sluggish and wondered if the version of SSHFS that came pre-installed with Macfusion was outdated.
3. Update SSHFS
Let’s examine the pre-installed version of SSHFS that comes with Macfusion. RIGHT-CLICK ( or CONTROL-CLICK) on the Macfusion app in the Applications folder. You will be presented with a contextual menu. Choose the “Show Package Contents” menu option. You will then be presented with a folder containing the application folder hierarchy. Drill down until you see an application called sshfs-static.
Macfusion application hierarchy showing the location of the pre-installed version of SSHFS
This is the copy of sshfs that Macfusion uses to do its magic. To check its version, I opened up the Terminal app, changed directory to the parent folder off sshfs-static and typed in ./sshfs-static -V . You don’t have to do this by-the-way, just skip to the Download and Install SSHFS section.
% cd /Applications/Macfusion.app/Contents/PlugIns/
sshfs.mfplugin/Contents/Resources/
% ls -la
total 5736
drwxr-xr-x 9 chandima staff 306 Aug 4 2008 .
drwxr-xr-x 5 chandima staff 170 Aug 4 2008 ..
-rwxr-xr-x 1 chandima staff 46928 Aug 4 2008 new_sshfs_askpass
-rwxr-xr-x 1 chandima staff 2756952 Aug 4 2008 sshfs-static
-rw-r–r– 1 chandima staff 13259 Aug 4 2008 sshfs.png
-rw-r–r– 1 chandima staff 6796 Aug 4 2008 sshfsAdvanced.nib
-rw-r–r– 1 chandima staff 7609 Aug 4 2008 sshfsConfiguration.nib
-rw-r–r– 1 chandima staff 61418 Aug 4 2008 sshfs_icon.icns
-rwxr-xr-x 1 chandima staff 29280 Aug 4 2008 sshnodelay.so
% ./sshfs-static -V
SSHFS version 1.8 (MacFUSE SSHFS 1.3.0)
MacFUSE library version: FUSE 2.7.3 / MacFUSE 2.0.3
no mount point
The pre-installed version was 1.8. I wondered if I’d get a speed increase if SSHFS was updated to the latest version which was 2.2 (as of this writing).
Download SSHFS from:
http://code.google.com/p/macfuse/wiki/MACFUSE_FS_SSHFS (make sure you download sshfs-static-leopard.gz ).
After you uncompress the gzip archive, you will end up with a folder called sshfs-binaries. In there, you will see an app called sshfs-static-leopard.
Rename sshfs-static-leopard app to sshfs-static to match the filename that Macfusion expects.
Replace the old version of sshfs with the new version:
Drag and drop the downloaded and renamed sshfs-static executable into the Resources folder to replace the older version within the Macfusion package hierarchy.
You can check the version again to make sure that the new version is recognized.
% ./sshfs-static -V
SHFS version 2.2 (MacFUSE SSHFS 2.2.0)
MacFUSE library version: FUSE 2.7.3 / MacFUSE 2.0.3
no mount point
I unmounted and remounted the filesystem and the speed increase was quite significant. I highly recommend that you do this third step.
That’s it! Now you can access your remote SSH folders as a local volume.