Lisi Reisz wrote: > On Tuesday 14 June 2016 18:08:45 Brian wrote: >> With avahi-daemon installed on both machines >> >> ssh hostname.local >> >> should just work. No messing with config files or anything like that. >> >> /etc/hosts is fine if you are more comfortable with it but an IP address >> changing can make it a pain on the local LAN. > > Works a dream!! Thank you, Brian. That was a remarkably easy lesson! I > might set a hosts file up as I was shown by emetib. It doesn't hurt > to know both, and I might some time want to ssh into a machine that > hasn't got avahi-daemon installed. > > But I can see that changing IPs around could be a pain - I have several > machines that have two network cards for one reason or another, and I > have assigned different IPs to different cards in the router.
This is a little more "involved" than /etc/hosts or ahavi-daemon, but you might consider isc-dhcp-server and bind9 on a box you designate as "your server" (I have it on a spare desktop sitting in the corner). That way, - you don't have to mess with /etc/hosts as things change (e.g. got a new computer) - you don't have to worry about "oh, that one doesn't have ahavi-daemon" - you can use hostnames with networked device, including those things that may not have hostfiles or a decent bonjour client (phones, tablets, TVs, etc.) - Other stuff I'm forgetting :) - When you replace your router (or get a forced 'upgrade' from your ISP), you don't have to deal with "fixing things" beyond the router itself. -- |_|O|_| Registered Linux user #585947 |_|_|O| Github: https://github.com/dpurgert |O|O|O|