" /> UrlBlogGrey: February 2008 Archives

« January 2008 | Main | March 2008 »

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.