• Home
  • About
  • Archives
  • Books
  • Colophon
  • Policies
  • Resume
  • Tumblr

zanshin.net

because not enough websites start with the letter “Z”

Feed on
Posts
Comments
Tumblr
« USB 2.0 is Way Faster
Learning Cello »

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:

  1. MacFuse
  2. Macfusion
  3. sshfs (to update the pre-installed version that comes with Macfusion)

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.

Macfusion_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.

Macfusion_ssh_tab

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

Macfusion_ssh_advanced_tab

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.

Macfusion_macfusion_tab

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

Macfusion_log_viewer

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.

Macfusion_rename_sshnodelay

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-orig

And 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.

Tags: macfuse, ssh, sshfs

Posted in nerdliness

Comments are closed.

  • Welcome!

    Mark H. Nichols is a software architect, martial artist, nerd, and all around good guy. He works at Kansas State University in Manhattan Kansas, and lives with his wife, two cats, a pair of 7-foot Kawai concert grand pianos, a violoncello, nearly a dozen computers, and a 2010 Honda Insight EX. You can read more about Mark, and this site, or explore the archives.
  • last 3 tweets

    • Reformatting an SD card that got viruses about 3 years ago. It's a long story. You should ask me sometime. # 1 hour ago
    • The hardest part about making dumplings is not looking in the pan for 20 minutes while they cook. #hungry #stew #dumplings # 2010/03/14
    • @feliciaday Codex? # 2010/03/13
  • Most Popluar

    • Using jQuery to Create iGoogle Style Drag-and-Drop
    • Installing PostgreSQL on Mac 10.6 (Snow Leopard)
    • geek. : nerdliness is next to godliness
    • Solfège
    • Using SSHFS, MacFUSE, and Macfusion to Access Remote Filesystems
    • Solfège Repertoire
    • Install Eclipse Ganymede on Ubuntu 9.04
    • Solfège Left Thumb Pain
    • Using CRON to Control TimeMachine Backups
  • Categories

    • diversions
    • elsewhere
    • family
    • health
    • life
    • links
    • meme
    • nerdliness
    • photography
    • random
    • relationships
    • social issues
  • Archives

    • Blogroll

      • Change.gov
      • Elfenbein Klaviermusik Notes
      • Shawn Blanc
      • Sibylle Kuder

zanshin.net © 1996 - 2010 All Rights Reserved.

Policies | Web Hosting: Blue Host