10.4: A detailed look at MacFUSE and the SSH file system
Sep 11, '07 07:30:00AM
Contributed by: gruffell
Have you ever been been at work or somewhere else and wished you could access the files on your home computer remotely and safely? (Or maybe the other way around?) I've just helped someone set up a remote connection through a router to their work machine so they can access the files from home. (Of course this only will work if it's your computer and you have authorization to modify the router settings and remotely access the computer.)
Google provides MacFUSE (File System in User Space) that provides this ability via a secure (SSH) connection, and it's fairly easy to do. Basically, with MacFUSE installed, it's like having the remote computer's hard drive mounted on your desktop (remember it'll be a little slow via the internet), but you can do anything on the remote machine that you need to (providing you have the related applications on the local machine to access the remote files). The real advantage here is it's a much more secure method and passwords do not get sent in the clear.
For the setup I just did, the hardest part was getting the LinkSys router to set a static IP address for the remote machine, which is necessary for this project. I ended up doing a firmware upgrade to the router (definitely NOT for the faint-of-heart) but the resulting router system was far superior to the standard Linksys software -- but that's a whole other subject.
[robg adds: What follows is a more detailed version of this hint, and it contains a bit of updated information. If you found the original hint detailed enough, then you'll probably find this one redundant.]
If you are looking for more detail on the FUSE project, check out the project's Google Code page. There you'll find links for downloads, and a Wiki for help as well as a Google video talk about the project. One thing that stumped me for a bit was making the initial first connection -- you have to do the first connection via Terminal to get a key for that machine, but from then on it's very straight forward.
Getting Started:
If you don't have 10.4 or later, don't read any further.
Setting Up the machine to share:
- Be sure you have a "good" (e.g. secure) password on the machine you are going to access.
- Go to System Preferences » Sharing and turn on Remote Login from the Services tab.
- If this machine is behind a router/firewall, then you will have to set the router to give this machine a static IP address, and set the router to forward port 22 to that machine's IP address.
- Get the external IP address (i.e. via checkip.dyndns.org) of the machine or the router (or domain name) and record it. Be sure you know the username and password of the user on the machine you are going to access.
Setting up the remote machine (only needs to be done once):
- From the MacFUSE downloads page, download and install the MacFUSE-Core and sshfs DMG files. Note: these are not needed on the computer you are trying to access, only on the computer that you are going to be connecting from.
- Read the 'SSH file system for MacFUSE' and 'Using the Graphical Application' sections of the MacFUSE Wiki.
- So that the SSHFS - MacFuse program has a valid key to access the other machine, it needs a security key. To set this up, open terminal and type ssh -2 username@ipaddress, where username is the username of the account on the remote machine and ipaddress is the IP address of the remote machine or its router (could be a domain name). If all goes well you will be asked for the password for that account, and you will be prompted to accept the security key -- you must type YES (not Y) to do so.
You are now ready to use the graphical interface, so quit Terminal. If the IP address of the machine you are trying to access changes, you will need to redo the above steps using the new IP address.
Using MacFuse:
- Launch the file system that you want to use -- in this case SSHFS.app
- SSHFS.app will prompt you for the following:
- server: this is the domain name or the IP address you recorded above
- username: the same one you used above in Terminal
- remote dir: in most cases you'll leave this blank
- If this is your first use, click Connect; otherwise, click Cancel and to the File » Recent SSH Servers item and pick the server you want to access.
- Enter the password and press Return
You can now access the remote files -- when you are done, remember to eject the drive and quit the SSHFS app.
What else can MacFuse do?
- Watch the MacFUSE Tech Demos from Macworld Expo 2007 to get more ideas.
- Download some of the other file systems discussed in that video from the downloads page (only SpotlightFS as of now).
- Read about and download MacFusion. [robg adds: This site appears to have vanished, at least as of the morning of September 11th.]
- NTFS setup info is available in this hint.
- At this time, the picassa and docs modules aren't available, but hopefully they will be in the future.
Comments (17)
Mac OS X Hints
http://hints.macworld.com/article.php?story=20070904180753526