Network Your Classic Macintosh with …Linux, Part 5 – Using sshfs

Multi OS Networking

Today we present part 5 in our series of posts examining some of the various and interesting ways that you can connect your classic Macintosh with other computers on your network. The topic of the day is networking your Mac to Linux using sshfs to connect from the Linux system to the Mac.

Networking with NFS

Networking is a complex and endlessly variable topic, but even so, we near the end of this series at last – there is only one post after this one.

By this point in the series, curious readers are probably beginning to wonder why the iconic Linux penguin has graced the opening image of every one of these posts without ever being mentioned. Well, today we will finally address Tux’s reason for being one of the marquees of this series. For those of you who are not Linux literate, “Tux” is the name generally given to the beloved Linux mascot, the penguin.

Linux-Kernel1

The long and the short of it is that Tux is there because I needed him. Back in 2004, having grown tired of all the viruses, anti-viruses, malware, security updates and the constant state of computational danger associated with using Windows, I made a dramatic move, chucked the whole thing out and moved to Linux. Instant virus/malware/security relief ensued, and I became a very happy Linux camper for two years. There was just one lingering problem. There was a critical program that had no Linux peer, and that I used constantly – Photoshop.

Back in 2004, GIMP simply wasn’t good enough to replace Photoshop, especially for those of us keen on absolute fidelity in color reproduction. That single unfortunate fact forced me to keep Windows around for the sole purpose of running Photoshop. And so it was until 2006. By then, the 3.0 MHz Pentium IV box that I was using as my prime Photoshop engine was definitely starting to feel a bit long in the tooth. With so much new and faster technology available at that point, it was clearly time to consider upgrading to a better machine.

For the first time ever, I gave serious consideration to getting a Macintosh. The Power Mac G5 had caught my imagination. The G5s were supposed to run Photoshop up to 150% faster than anything else could, and a Mac would allow me to retire Windows entirely and have just one computer that could do it all. The “halo effect” from the absolutely fabulous iPod I had acquired that same year helped push me over the edge, and in mid-2006, I purchased my first personal Mac, a dual core, 2.3 GHz Power Mac G5 running Mac OS X 10.4 Tiger. It was odd stepping “up” to a 2.3 GHz machine from a higher clock rate 3.0 GHz machine, but as Apple so eloquently reminded us in their descriptions of “the megahertz myth”, all GHz are not created equal. Despite the nominally lower clock speed, in real world practical use the G5 was about 150% faster than the machine it replaced.

PowerMac G5

Being a diehard Linux user of two years by then, I had Linux on several computers in the house and the first thing I wanted to do with my new Mac was to network it to those existing Linux boxes. To say that this was a challenge would be the champion of understatements.

The wisdom of the day held that the use of Microsoft’s SMB protocol (which we looked at in the first two installments of this series) was the best and most universal approach. This may have been the case, but ease of use and ease of configuration have never been Linux strong points, and this was particularly true for SMB. Anyone who has ever struggled to get Samba (the Linux implementation of SMB) running on Linux will appreciate the truth of what I am saying. I have ten dense pages of notes in my log book from that time, documenting my tortuous, if ultimately successful, quest to get SMB running from Linux to my new Mac.

samba_logo

Thinking that there had to be a better way, I experimented with NFS, with similar results. The bewildering complexity involved on the Linux side contrasted sharply with the ease of setup and use on the Mac.

There HAD to be an easier way, and I finally unearthed it in an application called sshfs, the SSH File System. Linux fans will recognize this as a FUSE-based Linux capability that provides a user space remote file system by leveraging SSH for fundamental connectivity. Even on Linux, sshfs has the singular attribute of being remarkably easy to use. sshfs is as easy to run on the Linux side as it is to set up on the Mac side… and the Mac side could not get much easier. On the Mac side, just go to the Sharing control panel and check the “Remote Login” checkbox. Mac OS X has an embedded SSH server which is started when this box is checked. The Linux side is equivalently simple: run a single shell command and you are off and networking.

Remote Login Checkbox

Now Linux is a many-splendored thing, and the steps required to get sshfs installed and operational on any one distribution can often be wildly different from the steps required to accomplish the same thing on any other distribution. With this in mind, and noting that it is beyond the scope of this Macintosh-focused blog to go into the specifics of Linux software installation anyway, I won’t go into the gory details of how I got sshfs up and running. In general however, let me say that it can often often be as simple as starting the distribution’s package manager, selecting the sshfs package, and installing it. It can then be run directly from the command line, or configured as a permanent startup item.

In my case, I installed the Linux on the machine I used for this testing way back in 2007, shortly after I built the machine. The machine in question is the well-storied 200 MHz Pentium Pro box that has figured so often in tales told in past posts of this blog. In addition to the Windows NT 4.0 that has been mentioned so any times, it also runs Arch Linux Duke 2007, in a dual boot setup. I installed sshfs at the time I installed Arch Linux, and it has been there ever since.

I love using sshfs for Linux file sharing because it is just so darn easy to use. There is no firewall configuration, no /etc/hosts alterations, no name resolution issues to work through… nothing. Just start it and it works! Here is what starting sshfs to my Power Mac G5 looks like under Arch Linux on the above Pentium Pro system:

sshfs-cmd-linux

Dissecting the above shell command, it tells sshfs that my Power Mac G5 has local address 192.168.0.21, my userid on it is “mac57” and that it should be mounted on mount point /mnt/g5. That is it, that is all! One simple command, and even one that is largely absent the arcane syntax of so many Linux commands. As you may be able to see, I have embedded even this fairly simple command into a script called “mount-g5” to make it even SIMPLER to use.

This command prompted me for my login password (after all, this is SECURE Shell!) and then connected me straight away. My Power Mac G5 was now accessible like any other folder on the system, available as /mnt/g5.

For Linux power users, I issued the “mount” command and captured its output, so that you could see the particulars of the mount involved. The screen shot appears below:

mounted-g5-linux

At this point, I could browse the G5 remotely from my Linux system using any file manager of my choosing. Since my Pentium Pro system is not a computing heavyweight, even at 200 MHz, I have loaded it with the lightweight combination of XFCe and Rox Desktop, delivering fairly good performance even in a low powered environment. Hence, I browsed the G5 using Rox Filer and the result looked like this:

browsing-g5-linux

I could both read and write files. In fact, all of the screen shots presented in this post were taken with GIMP on the Pentium Pro Linux system and then transferred to the G5 using simple drag ‘n drop via Rox Filer.

Thanks to this simple to use and convenient application, networking between Linux and your Mac OS X system need not be too strenuous. I would love to be able to use this same approach to network Linux to Mac OS Classic as well, but I have never been able to find an SSH server for Mac OS Classic. If you should be aware of one, please leave a comment and let us all know!

Closing Thoughts

That wraps up this post. In this second last post of the series, we have examined the use of sshfs as a file sharing mechanism between Linux and Mac OS X, adding to our earlier examinations of SMB, FTP and HTTP as file sharing enablers. In the upcoming final post of this series, we will put all of the preceding file sharing methodologies together into the grand slam of networking. Stay tuned for the big finish! Until then, happy networking, no matter how you choose to do it!

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s