CrabApple Forest |

Picking The Good Ones & Crabbing About The Bad Ones

Secure Remote Disk: A GUI for MacFUSE and sshfs

Thursday May 1, 2008

If you read our earlier article about setting up MacFUSE and sshfs, you may have noted that it’s not exactly intuitive to save your settings, for easy and fast subsequent logins. Also, if for some reason you need to make multiple connections to the same server (for example, to simultaneously be connected under more than one account), that might entail some head-scratching.

Fortunately there are ways to make the connection process easier. In this article we will focus on a program called Secure Remote Disk, which provides a simple GUI for connecting to remote systems. It can be freely downloaded, but the author does ask for donations. You still have to install MacFUSE and (we think) sshfs (but feel free to try it with only MacFUSE installed, if you haven’t yet installed sshfs). You won’t need to use the sshfs application to make your connections. And, as with sshfs, once you have established the connections you can close Secure Remote Disk and the connections will remain in place.

To begin with, download and install Secure Remote Disk in the usual manner. Open the application and you’ll be greeted with a screen similar to this:

Secure Remote Disk

You will see there is already an example connection. “Name” is the name you wish to assign to the connection; it’s not used outside of Secure Remote Disk as far as we can see. We have actually modified the example slightly (as shown above) in order to make a couple of points. First, if you want the server name capitalized, do it for every mention of the server in this panel - otherwise it will appear in lowercase in Finder, which might look a bit strange if you drag the pseudo-drive into Finder’s left-hand sidebar menu (once again, it goes under the devices, not the shared locations), to make it accessible in all Finder windows.

The other, possibly more important point is that you must specify a directory in the lower text entry box - this is a directory on your Mac (not on the remote server), located off of your user directory (which is why it starts with ~/) that will become the link to the pseudo-drive. If you clear this field, you may find that Secure Remote Disk simply hangs, and if you then close and and attempt to re-open it, it crashes on startup. The only way to restore operation is to delete the preferences file for the program (which is found at
~/Library/Preferences/de.prima.jan.SecureRemoteDisk.plist) and start over from scratch. Also, and this is a major difference from the sshfs application, the specified directory cannot be in /Volumes (which is where sshfs normally puts it) - it must be off of your user directory (if you try to put it in /Volumes, it will put it in your user directory anyway!). For most users this will not make any difference, with the caveat that the directory name should not match any existing directory name that you already have, unless that directory was created by Secure Remote Disk (or you) expressly for this purpose. The directory will look like a normal directory when not connected to the server, but you should resist any urge to use it as a normal directory (for storing files, etc.).

Also note that there an Advanced tab:

Secure Remote Disk - Advanced tab

Here you can change the port number for the connection (if the server uses a different port), optionally specify a directory on the remote server (not to be confused with the directory on your Mac that we talked about above), and if you are using a public key rather than a password for access, be sure to check the box shown here.

We didn’t try using password access, but assume that when you attempt to make a connection that requires a password, the program will prompt you for it.

There was one thing about this software that we didn’t like, and we don’t know if it’s a problem with Secure Remote Disk or MacFUSE, or maybe even Finder. We tried making multiple connections to the same server using different user accounts. Although we (obviously) used a different connection name and directory for each connection, when we attempted to drag the connections into Finder’s left-hand sidebar menu, they copied properly but the names shown were that of the server, not the connection name or the directory name. In other words, if you had two connections to Example.com, and dragged them both into the left menu bar in Finder, both would be labeled “Example.com” and the only way to determine which was which would be to open each one and see what’s inside. It would be much better if each were labeled with the connection name, but we don’t know if that’s anything that the author of Secure Remote Disk would be able to do. We think that most users would likely want to have these connections in the Finder sidebar, both for easy access and because doing so provides an eject button next to each connection, which can be used to disable the connection if so desired.

The other thing we wish that Secure Remote Disk offered is the ability to automatically establish some or all connections at startup. As it is now, you have to start it up, click on each connection, then click on the “Connect” button. That’s certainly easier than using sshfs, but it would be nice if there were a checkbox associated with each connection, that if checked would just go ahead and establish the connection whenever Secure Remote Disk is started. Then you could add Secure Remote Disk to the list of programs automatically started at login, and your connections would be established automatically.

The thing that Secure Remote Disk provides is the ability to (relatively) easily make desired connections to your server(s). If you observe the caveat about not trying to leave the Directory field blank on the first screen (the field that specifies the local directory on your Mac), it seems to work very well.

Related posts


See your remote server (almost) as if it were a local drive: Installing MacFUSE and sshfs

Thursday May 1, 2008

Do you own, or have access to a remote server that is accessible via the Internet? Do you know how to, and are you able to make an SSH connection to it using Terminal or iTerm? If the answer to those questions is "yes", then I have another one: How would you like to see files and directories on that system appear in Finder on your Mac, just as if your filespace on that system was an external drive sitting next to your computer? This is not only possible, it’s fairly easy, especially once you get past the initial installation of a couple pieces of software.

The installation is a piece of cake, but it does require a system reboot First go to this page at Google Code and download the correct version of MacFUSE for your operating system, and while you are there you can also download the sshfs package:

Google Code page for MacFUSE

When you have downloaded the MacFUSE package, double click on it and it will mount the disk image. Inside you should see several items, including a package called MacFUSE Core. Double click on it and it will bring up the MacFuse installer.

MacFUSE .pkg icon

Next you will get the opening page of the MacFUSE installer, but first a word from the Apple Nanny:

Apple Nanny

After you dismiss that irritating screen, you can continue with the installation:

MacFUSE Install

Now, at this point we could show you a few more screenshots, but you really don’t need them - on every screen of the MacFUSE installation, all you have to do is click the obvious choice to continue. There are no options to deal with (well, we suppose you could change the default install location, but that’s probably not a good idea).

Unfortunately, in order to actually USE MacFUSE, you then have to reboot your Mac. Yeah, we hate that too. But once you have rebooted, you can then run the sshfs installer (EDIT: Before you do anything with sshfs, see our article on MacFusion: A BETTER GUI for MacFUSE and sshfs - we think you’ll agree it’s a better interface than sshfs. But if you want to install sshfs just to “get your feet wet” with this technology, that’s fine too, and in any case you should continue reading this article for information on ssh authentication, which is also applicable if you use MacFusion). This is just a normal application disk image so click on it to mount it, click on the license agreement, then drag the application icon into your applications folder in the usual manner. Now, when you want to connect to a remote site, just call up the sshfs application and it will prompt you for the information it needs to make the connection:

sshfs connect window

Note that after you have clicked on the "Connect" button, you may or may not be prompted for a password. This will depend on whether you have ever set up public and private keys for authentication without the use of a password on your SSH server. Generally, if you can SSH into the server without entering a password, then sshfs shouldn’t prompt you for a password either.

It’s beyond the scope of this article to explain how to set up ssh public/private key authentication, but there are literally thousands of pages indexed by Google that will tell you how to do it - naturally, some pages give better instructions than others. Try doing a Google search on something like "Mac ssh public key." (If you have found a page of instructions that you feel are particularly helpful, please leave the URL in a comment!)

Note that there are several options that can be used when setting up ssh public key authentication, and everybody that writes up the instructions seems to have an opinion on which options are the best, or generally speaking, the "correct" way to implement this. If only they all agreed with each other! So if you don’t know enough about it to evaluate the information on those pages, you might be better off sticking with using passwords for the time being - except that passwords are not as secure as key authentication, so maybe it would be a good idea to try and set up the key authentication if you can possibly manage it.

Anyway, once you have sshfs going and the connection made, all you have to do is go into Finder and find the icon for your connected share. If you don’t see it, click on any Finder window, then look at the top menu bar and you should see a selection labeled "Go", which when clicked on produces a drop-down menu:

Finder Go menu dropdown

One of the selections is "Computer" - click on that and it should show you a Finder window with all your mounted drives and shares, including (assuming you have successfully connected) the pseudo-drive that represents your ssh connection to the server. Note that you can drag the icon for this drive into Finder’s left-hand menu (under the devices, not the shared locations), to make it accessible in all Finder windows. This will also give you an "eject" button next to the share name, which if clicked should break the connection to the remote server. A possible alternate way to find the pseudo-drive is to look in the /Volumes directory. In either case, it will bear the name of the system you are connecting to.

Note that simply closing the sshfs application does not seem to break the connection to the server, so once the connection is established you can quit the sshfs app and get its icon out of your your dock area. Also, after you have made the first connection to your server, on subsequent connection attempts you should be able to call up sshfs, cancel the connection dialog, and then in the top menu bar click on "File", then "Recent SSH Servers" and select your server for a quicker reconnection.

If you are using a password, then you will still be prompted for it on each connection attempt. As far as we know, there’s no easy way to automatically establish the remote connection as part of the login process. Note that we said "no easy way", not "no way." We’ve found several techniques for doing it, but all involved the use of such things as shell scripts, Applescript, etc. and really seemed a bit overcomplicated to us. We’re thinking there just might be a way to do it in Automator but haven’t had the opportunity to experiment with that yet. If anyone knows of an elegant method for establishing the connection automatically at login (using entirely free software, of course), please let us know in the comments. Otherwise, if we ever figure out a way to do it, we’ll be sure to do a follow-up post explaining the procedure.

There is one known quirk of this software, and that is that it will always report that you have 1000 GB free on the remote system. Apparently this is something that they’ve been unable to work around. Also, bear in mind that this is not commercial software, so there may be a few other things that don’t work quite as you may expect, but on the whole it works remarkably well.

MacFUSE has other uses besides running sshfs. MacFUSE is the Mac implementation of FUSE, which stands for "Filesystem in Userspace." If you want to know more about FUSE, check out the Wikipedia article. One of the other more popular uses of MacFUSE is to allow use of NTFS-3G, a stable read/write driver that allows both read and write access to drives and devices that have been formatted using the Windows NTFS format (be sure to get the version that works with MacFUSE, and please note that we have not tested this so you may want to read up on it prior to installing it, and only use it if you feel it will reliably meet your needs).

Related posts