
I have a headless Fedora linux box that plugs in to my home network and gets an IP address from DHCP.
To find it I've been pinging the broadcast address, in my case 172.16.1.255, and then trying to ssh to each of the IPs that answer until I find it. Very agricultural. Seems like a great reason to use Zeroconf.
To advertise the sshd service, put this in /etc/avahi/services/ssh.service:
<?xml version=\"1.0\" standalone=\'no\'?><!--*-nxml-*-->
<!DOCTYPE service-group SYSTEM \"avahi-service.dtd\">
<!-- See avahi.service(5) for more information about this configuration file -->
<service-group>
<name replace-wildcards=\"yes\">ssh on %h</name>
<service>
<type>_ssh._tcp</type>
<port>22</port>
</service>
</service-group>
Here's another example showing how to include the path in the http url:
<?xml version=\"1.0\" standalone=\'no\'?><!--*-nxml-*-->
<!DOCTYPE service-group SYSTEM \"avahi-service.dtd\">
<!-- See avahi.service(5) for more information about this configuration file -->
<service-group>
<name replace-wildcards=\"yes\">myservice on %h</name>
<service>
<type>_http._tcp</type>
<port>80</port>
<txt-record>path=/0/1/</txt-record>
</service>
</service-group>
It's a good idea to set the hostname to something reasonable in /etc/sysconfig/network and reboot.
As root:
# chkconfig --level 35 avahi-daemon on
# service avahi-daemon start
Now you can Command-Shift-K in the MacOS Terminal to browse for the sshd service.
Even better, you can use Chicken of the VNC client to browse for a VNC desktop by putting this in /etc/rc.local
# start vnc for my username at boot
su -l username -c "/usr/bin/vncserver -geometry 1200x900"
(Replace username with YOUR username).
As you, run vncpasswd and set a password. You probably want to edit ~/.vnc/xstartup to uncomment the two lines that give you the full gnome desktop. Reboot.
Now run Chicken of the VNC, do an "Open Connection..." and you'll see the host in the list. Mine comes up as Display 1, your's might be different.
I wish this stuff was just on by default.