Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Mount a gateway-accessed server directly using MacFUSE Network
MacFUSE is a great addition to the OS X system. One common usage of a FUSE is to mount a remote directory as a local volume, for easy access, and with MacFUSE in conjunction with sshfs (available at the same link), this is really easy to do.

In my situation, however, the remote directory that I wanted to access was on a firewalled server that only allowed access through other machines on the some local network. I had access to various gateway machines, so access as such was not a problem, but it was a pain to have to hop through the gateway each time I need to transfer files to the firewalled server. Also, I could not use local applications to work on directly on files on the server, even if they supported ssh- and sftp-based editing.

I messed around with trying to set up an ssh tunnel, but got nowhere. When I finally turned to MacFUSE as an alterntive, I had everything set up and running within minutes.

You will, of course, need to be authorized to access both the gateway (from your local machine) and the server (from the gateway). However, you will also need to set up ssh for passwordless access in both cases (i.e., so that you can ssh from your local machine to the gateway, and from the gateway to the server without being prompted for logins). This is not difficult to do, and if you google for ssh passwordless login, you will find a ton of information. After you have the password-free ssh connections working, download MacFUSE and sshfs, and install both. Create a convenient link to the statically-compiled command-line binary on your system path:
sudo ln -s /Applications/ /usr/bin/sshfs
Now, mounting a remote directory using the ssh protocol itself is fairly straightforward:
sshfs user@host:/some/directory /some/mount/point -oreconnect,volname=volume_name
The trick is getting to the firewalled server. The solution is to execute the ssh command remotely from the gateway machine. To do this, save the following wrapper script as /usr/bin/gateway-ssh, and set it executable (chmod a+x scriptname) permissions:
#! /bin/sh
ssh ssh $@
Now simply use the -o ssh_command= option of sshfs:
sshfs -o ssh_command="/usr/bin/gateway-ssh" /path/to/mount/dir -oreconnect,volname=volume_label
Replace login_user, login_user,, user_name, and volume_label with the relevant values, and that's it!

The connected server does not pop up on your desktop, but you can see it if you open your Computer window. You could use the -o local option for more Finder-friendly behavior:
sshfs -o ssh_command="/usr/bin/gateway-ssh" /path/to/mount/dir -oreconnect,volname=volume_label -o local
To unmount, use umount /path/to/mount/dir.

[robg adds: I haven't tested this one.]
  • Currently 1.60 / 5
  You rated: 1 / 5 (10 votes cast)

Mount a gateway-accessed server directly using MacFUSE | 5 comments | Create New Account
Click here to return to the 'Mount a gateway-accessed server directly using MacFUSE' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Moun a gateway-accessed server directly using MacFUSE
Authored by: hamarkus on May 05, '08 08:08:58AM
Could one achieve the same with MacFusion (

[ Reply to This | # ]
Moun a gateway-accessed server directly using MacFUSE
Authored by: Fardilha on May 06, '08 12:00:15AM

If you decide do give MacFusion a try you might want to use the latest beta, 2.0 beta 3 ( ) since the official release, 1.2 beta3 doesn't seem to be working properly on the latest OS version.

[ Reply to This | # ]
Moun a gateway-accessed server directly using MacFUSE
Authored by: jg on May 06, '08 03:10:51AM
Yes, MacFusion can be used. When adding a new connection to the list of favourites, set the server name or IP address to that of the intended target (not the gateway), set the authentication to Public Key from the drop down list, and then add just the " -o ssh_command=/usr/bin/gateway-ssh " part of the command line to the area labelled Extra Options (Advanced).

By the way, this and other methods of sshfs connection via a gateway server can be seen at this post from 2007:

Wintel:- It is dark inside the box...

[ Reply to This | # ]

Mount a gateway-accessed server directly using MacFUSE
Authored by: BigCrab on May 06, '08 01:19:19PM

@Fardilha, we were in the process of updating our blog post on installing MacFusion and were going to suggest using the beta version, but we couldn't get it to mount the remote filesystem, and this was using the latest version of Leopard. On the other hand, the original version of MacFusion works fine for us. We didn't try stacking connections through servers (no way to test that from here) but if we had a need too, I'd bet the original version would work for that as well.

I'm glad to see that someone is still working on MacFusion, it's a great piece of software, and the next time a new beta is released we'll probably give it another go. But for now, we're sticking with the original. Strange that we'd have such opposite experiences, but I guess computers are just like that sometimes. :-)

[ Reply to This | # ]
Mount a gateway-accessed server directly using MacFUSE
Authored by: asmeurer on May 13, '08 08:22:29PM

The word "mount" is misspelled in the RSS feed.

[ Reply to This | # ]