How to mount SFTP/SSH shares in OS X

If you’d like to use an sftp share directly though finder then this guide is for you.

First, you need to install OSXFuse from https://github.com/osxfuse/osxfuse/downloads

If you’re using OS X 10.8 (or above…) use the default install options and skip down to the Mountain Lion section now.

At the “Installation Type” stage, be sure to select MacFUSE Compatibility Layer. It’s unticked by default.

Once installed, you need to get Macfusion from http://macfusionapp.org/

Perform the usual drag and drop into your Applications folder then run Macfusion.

Add a new Macfusion share by clicking on the plus icon and selecting SSHFS, enter your details, click ok, then mount. After a few moments your share will be available. You can press cmd+r to show your share in the Finder.

You can now directly edit files on the sftp share using any app on your mac without the need to manually download and re-upload them.

If this process does not work for you, try restarting your mac, then re-adding the Macfusion share.

OS X Mountain Lion

Unfortunately Macfusion doesn’t work well with Mountain Lion (OS X 10.8). You can, however, still mount directories using the command line (Terminal).

First we need to download, then install sshfs: https://github.com/downloads/osxfuse/sshfs/SSHFS-2.4.1.pkg

Run through the installer with the default options.

Now create an empty directory to mount your sftp share in, for example:

mkdir /Users/dan/sshfs

Then run the following:

sshfs username@serveraddress:/path/to/remote/folder /Users/dan/sshfs

Navigate to /users/dan/sshfs in Finder and you’ll have access to your sftp share.

  • Perfect!
    In OSX Lion 10.7 you can see the mounted volume on Desktop by ticking “Connected servers” in Finder Preferences.

    I hope this could help.

  • Thanks!

    It works using osxfuse and the Macfusion GUI!

    Only it will not get started at boot, I have to start it manually and press mount. On my Linux machines I have a script “mountsshfs” placed in “/etc/network/if-up.d” that do it automatically when network is connected. But I have never had a mac before so perhaps I just missed some step.

  • Erik

    Hey!

    Thanks man. this works perfectly!

  • Julian

    Thanks a lot. I tried this before and it didn’t work, I was getting an error that it disconnected or something. I had to remove the “HTTP://”

  • Awesome! Thanks!! I had tried this using macfuse and it just didn’t work but this saved my life!

  • Diego Ruiz

    I cannot see the FTP drive, even though MacFusion says it is mounted. I tried refreshing the Finder several times

  • Diego Ruiz

    Ignore previous message. However, one of the folders I want to open doesnt appear as a folder, but as a white page, and when I click on it, it says that the original item cannot be found.
    I am connecting to a Stora Netgear

  • Worked like a charm, way easier than messing around with the old MacFuse stuff.

  • Pingback: Mounting SSH shares as a volume in Mac OS X | Toadally Geek()

  • Cool! You just made my life a whole lot easier. Thanks for writing up this article. As you suggested, a reboot was necessary before I could successfully mount via SSH.

    • Dan Bishop

      Great to hear it helped you out! πŸ™‚

  • Thanks for the post. Easily the best I found for setting up mounted drives quickly and easily. I knew there had to be an easier way than buying expanDrive.

  • Jason

    After reading the article, I thought this would be easy. After following the instructions given above, I keep getting an error stating that “Authintication has failed.” Or that the mount has timed out. I know that my server credentials are correct, having had someone look over them with me over sip. Anny help on this would be wonderful. πŸ™‚

  • Achim

    Hmm, I don’t know what’s wrong, neither I got it working with Snow Leopard nor recently with Mountain Lion. There’s always an Authentication Failure with ssh remotes and with ftp I’m not able to copy any file to the remote machine.

  • Daniel Jones

    Thanks for this post. I was trying to justify buying ExpanDrive (which in my opinion is quite expensive), but this fits the bill perfectly.

  • breckstone

    Well, I found this post as I was searching the internet for a reason explaining why all file transfers over osxfuse+macfusion are running very slow. It is taking about 6 minutes to upload or download a 9MB file. Usually downloads in about 2 seconds using (scp) any ideas? Thanks

  • Octavio

    Worked the first time, but then somehow it didnt work again seems that some permissions to access the ssh key, any ideas?

    here is the log:

    (macfusionAgent, SSHServerFS, BA Dev, 9/28/12 7:06 PM) debug1: Server accepts key: pkalg ssh-rsa blen 279
    debug1: could not open key file ‘/Users/Octavio/id_rsa’: Permission denied
    debug1: No more authentication methods to try.
    Permission denied (publickey).

  • meursaultF

    same problem, since mount lion…

  • Thanks a lot, hopefully I will soon forget about Samba Nightmare πŸ™‚

  • Alex

    You are a saint. So very useful. There’s a reason this is the first result in Google…

  • geronimo

    nice, thanks you from France πŸ™‚

  • Thanks!
    Very simple e useful!

  • Thanks a lot. Your article helps me to mount my webserver in finder without any app.

  • Dang. I tried this a few weeks ago and nearly went mad. I’m using Lion. Tried again today and actually read the part where it said : “If you’re using OS X 10.8 (or above…) use the default install options and skip down to the Mountain Lion section now.”

    So easy! My life just got a lot easier. Thanks.

  • Thank you! This helped a ton!

  • SengSeng

    It seems not too many people know about this, but the 2.0.4 version of MacFusion has been forked.

    There is now a 2.0.5 version which is now compatible with OSX 10.7.x – 10.8.x

    Check out this blog page for news on this new 64-bit version

    http://patjack.co.uk/macfusion-64-bit-ready-for-lion-mountain-lion/

    Patrick has compiled the latest version and makes it available for download. So far so good on 10.8!

  • Jason

    How do we unmount?

    It might be good to tell others that if you have a .ssh/config file those settings get obeyed when running this from a terminal..i.e port settings, username, IP, etc.

  • Thanks for the tip on ML !

  • ian

    How do you unmount it?

    • albielin

      Just eject via Finder or from command line, umount -f /yourMountPath

  • ian

    Also, how do you set it to automount on boot of the mac?

    Many thanks btw!

  • James

    Thanks! Any idea how to change the name of the folder?

    • albielin

      I think you have to unmount, then create / change the folder name, then remount.

  • albielin

    Anyone find a way to get spotlight to index the sshfs mount? Everything I see online says it works fine to use mdutil -i on but it says “Error: unable to perform operation. Try as root. (-400)
    Error: unknown indexing state.”

    Trying as root, I get “Error: could not resolve path `/Users/albie/mdotm.com/hadoop/’.”

    • sarnobat

      I can’t even get it to do that. I thought it only allows you to specify volumes, not folders. I wish I could index this. All my music is stored on a server rather than my laptop

    • Cap. Pizzocchero

      Still the same error 3 years later on macOS Sierra 10.12.5.

  • Can you give an example of what to actually type in place of:

    user@computer:$ sshfs username@serveraddress:/path/to/remote/folder /Users/dan/sshfs

    I am trying to mount a R-Pi SD card to perform a repair on it.

    (And what the command is to repair it would be great too!) πŸ˜‰

  • Konika Chawla

    Hi, This was useful, but I had to do it again when I restart my systems. Is there a simpler way that I always have the icon to connect to server (mount it in finder), Thanks

  • You could also use WebDrive (www.webdrive.com) which will also mount the SSH server as a volume on Mac, and supports other protocols like WebDAV, FTP/S, and backend storage services like S3, Box, DropBox, OneDrive. It also runs on Droid, iOS, Surface, and Windows. Full disclosure, I work for SRT.

  • Pingback: Nifty bash/mac commands and software |()