Advertising SSH on Ubuntu
Up until today, I’ve only used my Ubuntu MacBook Air. My home network is mostly Apple products, so service discovery is built in. I want to enable and advertise the SSH service on the Air too.
First, I need to enable ssh. No big whoop:
Now I can ssh into the machine as air.local
. I set up SSH keys and so
on. But, I don’t see it advertised. That’s something under the purview of
avahi. That’s not an easy thing to casually use. I can publish the
service during a session:
And I can see it when I run dns-sd on my macOS machine. Start dns-sd first because it will sit there to watch the network for advertisements and output new ones as they come in:
To make it persistent, I can copy an example service from the examples to the live services directory:
Once all that is setup, I make an entry in ~/.ssh/config on any remote
machine where I want to start. I don’t want to type the entire air.local
so I give it a short name with Host
: