Jul 172011
 

Fuse4X is a port of FUSE – The Filesystem in Userspace to Mac OS X and allows you to mount all different kinds of remote / local filesystems on you Mac computer. A very popular ‘filesystem’ is sshfs, which allows you to mount a directory of a remote server to a local mountpoint (which is also a folder). You need to have access to the remote server via SSH to make this work.

Fuse4X is a modern replacement for the old MacFUSE implementation of Fuse for Mac OS.

You can either go to the website of the project, download, double click and install the files. Or you can use the terminal (what you should be able to do anyway if you know what SSH is and how to use it).

Using the terminal: The Homebrew variant:
The most recently accepted formula to install Fuse4X via Homebrew makes it really easy to install fuse4x and sshfs:

brew install fuse4x sshfs

Using the terminal: The manual variant:
Here is how you can install it including SSHFS on the Terminal:

cd ~/Downloads
## Download the latest version (as found on fuse4x.org) and install
wget https://github.com/downloads/fuse4x/fuse4x/Fuse4X-0.8.7.pkg
open Fuse4X-0.8.7.pkg
## Get the latest version of SSHFS (as found on github.com/fuse4x/fuse4x/downloads)
wget https://github.com/downloads/fuse4x/fuse4x/sshfs-2.3.0.zip
## Install sshfs binary to /usr/local/bin/sshfs (and install man page):
unzip sshfs-2.3.0.zip -d /

Whatever method you chose, you should be able to use the sshfs command on the terminal to mount remote filesystems via SSH access now. Options for Fuse4X (and therefore also SSHFS) can be found on http://fuse4x.github.io/options.html.
Here’s a quick example:

mkdir ~/mountpoint
sshfs user@some-host.net:/home/user/ ~/mountpoint -oauto_cache,reconnect,defer_permissions,negative_vncache,volname=somename

When you are finished with the remote files and folders, you can unmount the directory simply using:

umount ~/mountpoint

To uninstall Fuse4X, you may use the uninstall script uninstall.sh which has also been put into place on your machine by the installer:

sudo /System/Library/Filesystems/fuse4x.fs/Contents/Executables/uninstall.sh

To also get rid of sshfs, run:

sudo rm /usr/local/share/man/man1/sshfs.1 /usr/local/bin/sshfs

Preventing the creation of .DS_Store files on network drives mounted via SSHFS

If you use your SSHFS mount with other operating system you may not like the creation of hidden Mac OS files in the folders of your mounted share. To prevent this behaviour, the simplest way is to mount the sshfs mount with the option noappledouble. (I found this option when trying to find out, how MacFusion does this when it offers this feature for each individual sshfs share. I found its implementation here.)

Alternatively, you can tell Mac OS to not create these files on any network shares using:

defaults write com.apple.desktopservices DSDontWriteNetworkStores true

which will write this setting to the ~/Library/Preferences/com.apple.desktopservices.plist file.

To delete .DS_Store files from previous use of that share with Mac OS X, you can run the following command to recursively delete all files with this name in the directory /path/to/share:

find /path/to/share -name .DS_Store -exec rm {} \;

Resources

VN:F [1.9.22_1171]
Rating: 9.5/10 (17 votes cast)
SSHFS on Mac OS X 10.6.8 and 10.7.2 with Fuse4X, 9.5 out of 10 based on 17 ratings

Related Posts:

  36 Responses to “SSHFS on Mac OS X 10.6.8 and 10.7.2 with Fuse4X”

  1. 1) Just an hour ago a new version of Fuse4X (0.8.7) and sshfs (2.3.0) has been released https://github.com/fuse4x/fuse4x/downloads 2) To uninstall Fuse4X just use the script provided by the Fuse4X bundle http://fuse4x.org/faq.html#Q.2.3

    VA:F [1.9.22_1171]
    Rating: +1 (from 1 vote)
    • Thanks Anatol! I updated the instructions accordingly.

      VN:F [1.9.22_1171]
      Rating: 0 (from 0 votes)
      • A typo at line #4

        “open Fuse4X-0.8.6.pkg” -> “open Fuse4X-0.8.7.pkg”

        VA:F [1.9.22_1171]
        Rating: +1 (from 1 vote)
        • Thanks for having a close look at my instructions! → updated.

          VN:F [1.9.22_1171]
          Rating: +1 (from 1 vote)
          • No, it is not updated. I still see “Fuse4X-0.8.6.pkg” text. It should be 0.8.7 version here.

            VA:F [1.9.22_1171]
            Rating: +1 (from 1 vote)
  2. Doesn’t work for me. When trying to mount a volume via the sshfs terminal my MacBook Pro (10.6.8) freezes and I’ve to reboot it. The old sshfs version which requires macfuse still does work. Any suggestions?

    VA:F [1.9.22_1171]
    Rating: 0 (from 0 votes)
  3. […] UPDATE 2011-07-12 Use Fuse4X instead of MacFUSE!!! I wrote a new blog post on the topic: SSHFS on Mac OS X 10.6.8 with Fuse4X.. Thanks Markus for your hint to the Fuse4X […]

  4. BTW, you can also install fuse4x+sshfs via macports (http://www.macports.org/) as

    sudo port install fuse4x sshfs

    VA:F [1.9.22_1171]
    Rating: +1 (from 1 vote)
  5. You can also get Fuse4x to work with Macfusion:

    cd /Applications/Macfusion.app/Contents/PlugIns/sshfs.mfplugin/Contents/Resources
    mv sshfs-static sshfs-static.orig && ln -s /usr/local/bin/sshfs sshfs-static
    VA:F [1.9.22_1171]
    Rating: 0 (from 0 votes)
    • Thanks Joe for your comment. Nice hint! Philipp

      VN:F [1.9.22_1171]
      Rating: 0 (from 0 votes)
    • Sorry but it does not work for me. It looks like the disk is mounter for 1 second (the icon becomes green), then it is immediately dismounted. No error message, nothing. Any idea? Thanks!

      VA:F [1.9.22_1171]
      Rating: 0 (from 0 votes)
      • @ailefroide: you likely just have an incorrect setting. In particular, make sure you have a Path value in the ssh tab.

        VA:F [1.9.22_1171]
        Rating: 0 (from 0 votes)
  6. […] vor einiger Zeit hatte ich bei Philipp von Fuse4X gelesen. Fuse4X will das nicht mehr gepflegte MacFuse […]

  7. I have problem saving files (Xcode) that lies in subdirectories of the Mount-folder. Works fine for files lying directly in the Mount-folder. Any suggestions?

    VA:F [1.9.22_1171]
    Rating: 0 (from 0 votes)
  8. With FUSE – The Filesystem in Userspace you can mount all different kinds of remote / local filesystems on you Linux/Unix/Mac computer. Here are some implementations of interesting FUSE filesystems: […] , SSHFS, […]

  9. tnx man !

    VA:F [1.9.22_1171]
    Rating: +2 (from 2 votes)
  10. […] Install sshfs via Fuse on Lion (HT: Siracusa) […]

  11. […] Thanks to Philipp Klaus for the sshfs info […]

  12. Hi, This didn’t work for me. Brew is pretty cool but every time I would try and run sshfs I would get an error message saying there was a problem with the kernel extension sshfs. So I ran “brew uninstall sshfs fuse4x” and instead ran these two packages: http://osxfuse.github.com/ https://github.com/osxfuse/osxfuse/wiki/SSHFS I ran their .pkg files and it works great. Thanks, Jordan

    VA:F [1.9.22_1171]
    Rating: +1 (from 1 vote)
  13. […] http://blog.philippklaus.de/2011/07/sshfs-on-mac-os-x-10-6-8-with-fuse4x/ So instead I ran these two packages: http://osxfuse.github.com/ https://github.com/osxfuse/osxfuse/wiki/SSHFS I ran their .pkg files and now I can run commands like this: mkdir remoteserver/ sshfs jordan@[My IP or Domain]:/ remoteserver/ And it mounts in Finder like a regular directory. I can right click and eject the folder from within the finder. Neat! […]

  14. it’s work for me but I download it from the browser and installed it manually. Thanks.

    VA:F [1.9.22_1171]
    Rating: 0 (from 0 votes)
  15. […] Thanks to Philipp Klaus for the sshfs […]

  16. it’s work for me but I download it from the browser and installed it

    VA:F [1.9.22_1171]
    Rating: 0 (from 0 votes)
  17. I ran their .pkg files and now I can run commands like this: mkdir remoteserver/ sshfs jordan@[My IP or Domain]:/ remoteserver/ And it mounts in Finder like a regular directory

    VA:F [1.9.22_1171]
    Rating: 0 (from 0 votes)
  18. I have Mountain Lion now (big mistake upgrading imo) and I’ve installed fuse4x/sshfs using homebrew… but every time I try to mount it just fails with the message “Bad address.” Can anyone else repro or have solutions for this?

    VA:F [1.9.22_1171]
    Rating: +1 (from 1 vote)
  19. Hi

    I am trying to connect from 10.8.1 to Oracle Linux 6.3

    I can mount it as a volume and I can copy from Linux to my mac but I can not copy from my mac to linux, it says not enugh space or some data can not be read or written

    I log in as root and admin and no difference

    thanks

    VA:F [1.9.22_1171]
    Rating: 0 (from 0 votes)
  20. Hi,

    Thanks for this tutorial. Unfortunately, this fails under Mountain Lion because wget is missing. It seems I have to install manually and possibly compile many open-source tools to get something out of this. I explored MacPorts, but it was going to be more complicated to learn all the different commands without any getting started howto than recompiling the tools themselves! But without GCC, no way to compile anything. I guess GCC is not bundled in ML as well. It seems I made all sorts of incorrect choices: OSXFuse instead of Fuse4X, MacPorts instead of Homebrew. Having it wrong all the times starts to suck me a lot. I feel I am completely out of the blue.

    VA:F [1.9.22_1171]
    Rating: 0 (from 0 votes)
  21. […] If you do install Samba then be sure to firewall it off to the whole world (including you) and then use ssh tunneling to connect to it. This way it's encrypted using ssh. There's also sshfs. […]

  22. […] and then use ssh tunneling to connect to it. This way it's encrypted using ssh. There's also sshfs (short howto and note Fuse4X has merged into osxfuse). Also, in that case since you're likely going to have ssh […]

  23. Thanks for the info, works fine for me (or did until I changed the default ssh port number). How do you insert a custom ssh port into the line: sshfs user@some-host.net:/home/user/ ~/mountpoint -oauto_cache,reconnect,defer_permissions,negative_vncache,volname=somename

    VA:F [1.9.22_1171]
    Rating: 0 (from 0 votes)
    • sorry ignore last reply, worked it out, just add -p port.no on the end.

      VA:F [1.9.22_1171]
      Rating: 0 (from 0 votes)

 Leave a Reply

(required)

(required)

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>