Main

February 23, 2008

Advertising SSH over mDNS (Rendezvous) with Avahi

A couple months ago, I posted some instructions for configuring a Linux system to run the Apple Filing Protocol (AFP) so that it could work as a network file-server for Macs. The AFP shares are advertised using a protocol called mDNS, or, as Apple has branded it, Rendezvous. mDNS is a great way for computers and appliances on a network to notify each other about the services they offer. This can greatly simplify access to these services. Note that it doesn't necessarily make those services any less secure; they're just explicitly advertised. Security of services should not depend on them being hidden.

So, I wanted to configure my Linux machine to also advertise the Secure Shell (SSH) it runs. This way it will show up in the Mac OS X Terminal application automatically as one of the available hosts to connect to. This is shown in the image below:

ssh_connection.png

If you've already got Avahi running on your Linux machine, then advertising this additional service will be simple. As the root user, changes directories to /etc/avahi/services and create a file called ssh.service. Paste the following text into the new ssh.service file:

<service-group>
  <name replace-wildcards="yes">SSH on %h</name>
  <service>
    <type>_ssh._tcp</type>
    <port>22</port>
  </service>
</service-group>
Finally, restart the Avahi service with /etc/init.d/avahi-daemon restart.

March 26, 2006

Installation of Fedora Core 5

I've been using Fedora Linux for about two years, and have witnessed the evolution of what I consider to be the most polished derivation of Redhat Linux yet. A major overhaul has taken place with all user-interface components, and I think that they've done a great job of "letting fresh-air in" on the Linux user-experience. The inclusion of bubbles in the new Fedora logo, and copious shades of blue make a smile come to my face. What can I say, I'm a sucker for blue.

A feature I was hoping to take advantage of was a VNC-based installation. Fedora Core 5 provides the option of having the installer start a VNC server, or connect to a remote VNC client, so that the installation can be driven over the network. Since my Linux box is normally "headless", I was excited about the possibility of conducting the installation from my Powerbook rather than dragging the PC beast over to my desk. I tried running the installation in client- and server-modes, but had luck with neither. Woe is me...

The Gnome desktop manager is a lot snappier than I remember it being in Core 4. I'm not sure if it's due to the ugprade of the X11 system, or the changes to the Core 5 themes and such. In any case, I really appreciate it!

February 18, 2006

NdisWrapper and Network Adapters on Linux

I've got a spare PC (Pentium 4 3.0GHz) sitting in the closet that I'm eager to find a use for. It is a memento from when I worked from home on the 3D Marketing start-up in 2003. Shortly afterwards, I became a Mac convert and shunned all thing PC. But that doesn't mean the PC won't make a good Linux box!

I'd like to put it in a closet somewhere in the house because, like most PC tower cases, it makes a noticeable amount of noise. This isn't so with our Powerbook G4 or Mac Mini - just silence. So, the only wire running to the PC should be the power cable. I'd like to use a wireless adapter to connect the Linux box to our wireless network. The network is secured using WPA2, which is worth noting because not all wireless adapters and drivers support WPA2.

We recently began using a Netgear FA120 wired Ethernet adapter to connect our Tivo to our home network, which made available our D-Link DWL-G122 USB wireless adapter. I'm thinking that the DWL-G122 will be a good fit for the Linux PC. But there is the issue of drivers...

NdisWrapper is an Open Source project aimed at producing a Linux-compatible interface to proprietary network drivers designed to be used with Microsoft's Network Driver Interface Specification (NDIS). Basically, this means you can use a Windows network driver in Linux. Sounds sweet, if it works. It is unfortunate that the closed-source policies of most hardware designers forces end-users to pull stunts like this.

I still need to install Fedora Core 4 on the PC, and only then will I be able to determine if the DWL-G122 wireless adapter will work. You can Google this type of problem for hours; but in my experience, I've found so much contradictory and incomplete information about Linux configuration issues that it is best just to experiment with the issue oneself. Plus, the risk of damaging the hardware or data-loss are virtually zero.

December 10, 2004

Objective-C

Since I purchased my Apple Powerbook in July, I've wanted to get some experience developing Cocoa (Objective-C) applications. I subscribe to O'Reilly Safari, which provides me with a huge library of technical books to draw upon. "Programming in Objective-C" (Stephen G. Kochan) is the best book I've encountered yet. I haven't programmed in C since university (nearly 4 years), and Java has given me a nice, cozy environment safe from memory leaks (usually), pointers and other non-niceties. But C is powerful. And 1337. This book is great for a non-C programmers, or those who are a bit rusty and want to make a transition to Objective-C. The language is quite elegant. It's got all the power of C, with the ability to define objects in a manner almost identical to Java. And no C++ oddities.

November 11, 2004

And Then She Sed What?

This is why I need a good development IDE like Eclipse; however, I work for the government and am left only with my faithful-but-cumbersome copy of XEmacs. I need to change the package name for a set of Java classes, which results in a cascade of changes in and out of the package. Argh.

Thankfully, there is 'sed'. Sed is an old-school UNIX tool for performing text substitution with regular expressions. So I drop this little shell script, let it run, and get back to BoingBoing.

for file in `find . -name "*.java" -print`; do 
  mv $file $file.bak;
  sed 's/oldpackage/newpackage/g' $file.bak > $file; 
done