Using SSHFS, MacFUSE, and Macfusion to Access Remote Filesystems
Nov 6th, 2009 by mark
SSHFS
sshfs is a secure file system client that allows you to access and manipulate files on remote systems where that would normally be available via SFTP. sshfs is dependent upon FUSE or Filesystem in Userspace. FUSE is available for Linux, FreeBSD, NetBSD (as PUFFS), OpenSolaris, and Mac OS X (as MacFUSE). It was officially merged into the mainstream Linux kernel tree in kernel version 2.6.14. h1.
The Pieces of the Puzzle
You will need to install three applications / frameworks:
Installing MacFuse
MacFuse is an OS X implementation of the Filesystem in Userspace (FUSE) framework. FUSE provides an API to write a virtual file system. Variations of the virtual file system include:
- PicasawebFS, for manipulation images in a Picasa account like they were stored on your local machine
- RSSFS, which allows you to mount an RSS feed as a filesystem and access each entry as an individual file
- SSHFS, or the Secure Shell Filesystem, which allows you to mount a remote computer directory through a secure shell (SSH) login.
Download and install MacFuse from Google Code: http://code.google.com/p/macfuse
At present the preference pane that MacFuse installs is 32-bit, so your System Preferences will restart in 32-bit mode when you select the MacFuse pane. The only option it exposes is a check for updates.
Installing Macfusion
Macfusion is an open source SSHFS mounting application for Mac OS X.
Download and install from: http://www.macfusionapp.org
Setting up an SSHFS file system
Once Macfusion is installed, start the application and click on the plus icon in the bottom left of the main window and choose SSHFS.

Set SSHFS mount parameters
Under the SSH tab:
- Host: The _hostname_ of the server that you SSH to.
- User name: Your SSH username.
- Password: Your SSH password. (At present I don’t know how to enable this via SSH Keys.)
- Path: This can be left blank.

Under the SSH Advanced tab:
- Port: The default SSH port is 22 unless the server uses a different one.
- Follow Symbolic Links: Leave this checked

Under the Macfusion tab:
- Mount Point and Volume Name: Can be left blank.
- Ignore Apple Double Files: You must uncheck this if you plan to open/edit/save files on the mounted volume. While allowing for remote editing of files is a powerful feature there is a downside. Mac OS X will place .DS_Store and ._* (Apple double) files on the server. OS X utilizes these hidden files for enhanced filesystem features and extended attributes in non-OS X filesystems. Since they start with a dot (.) these files should be invisible on the remote system. You may leave this option checked if you only plan to copy/move/delete files (it will also increase speed).
- 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 of the connection. For example, if multiple users are using your mounted disk space leave this unchecked.

Mounting the Remote filesystem
You are now ready to mount the SSHFS on your desktop. Click on the mount button and if the SSH settings are correct you should have a green disk icon mounted on the desktop. (Note, you may need to visit the Finder preferences to make sure that you are allowing *Connected Servers* to be displayed.) You should now be able to access the remote files as if they were on an external disk attached to your system. You can copy, move, rename, and delete files. Remember, that in order to edit files you must uncheck the Ignore Apple Double Files option. This can only be done with the remote filesystem is unmounted.
sshnodelay.so Error
If the mount operation fails, click the gear icon in the Macfusion main window and select the Log option (or use Cmd-L with Macfusion as the active application). If you see the following error message:
dyld: could not load inserted library: /Applications/Macfusion.app/Contents/Plugins/sshfs.mfplugin/Contents/Resources/sshnodelay.so

Then you need to rename or remove that library. Navigate to the /Applications/Macfusion.app/Contents/Plugins/sshfs.mfplugin/Contents/Resources directory and rename (e.g., sshnodelay.orig) or remove the sshnodelay.so file.

Update SSHFS
Now that you have a working connection it is time to verify the version of sshfs included with Macfusion, and update it if necessary. Using the Terminal, navigate to:
$ cd /Applications/Macfusion/Contents/Plugins/sshfs.mfplugin/Contents/Resources
The copy of sshfs that Macfusion uses is located in this directory. Run the command:
$ ./sshfs-static -V
to verify the installed version. As of this writing the current available version of sshfs was 2.2, if the displayed version is anything less than that, you will see a performance increase by updating.
Download SSHFS from: http://code.google.com/p/macfuse/wiki/MACFUSE_FS_SSHFS
For Mac OS X 10.6 you want to get the sshfs-static-leopard.gz file. Uncompress the gzip archive. Inside the resulting sshfs-binaries folder will be an application called sshfs-static-leopard. In Terminal rename the original sshfs-static application (assuming you are still in the /Applications/Macfusion/Contents/Plugins/sshfs.mfplugin/Contents/Resources directory):
$ mv sshfs-static sshfs-static-origAnd then copy the new version into place:
$ mv ~/Downloads/sshfs-binaries/sshfs-static-leopard sshfs-static
This should result in a significant performance increase.
Preventing .DS_Store files over Network Connections
You can prevent .DS_Store files from being created on the mounted filesystem by executing the following command in Terminal:
$ defaults write com.apple.desktopservices DSDontWriteNetworkStores true
This will affect interactions with SMB/CIFS, AFP, NFS, and WebDav servers. You will need to restart the computer or log out and back in to your user account for this change to take effect.