I have a local network of machines which, I hope, are all using Zeroconf/Avahi/Bonjour.
I want only users on local machines to be able to ssh to these machines. (All users except root).
Can I just put the lines
PermitRootLogin no
AllowUsers *@*.local
in /etc/ssh/sshd_config in each of these machines? I’m not sure of wildcard possibilities.
Do I have to worry about what else is in the file and where? (To start off with, all the machines will have Ubuntu Mate 16.04 with default /etc/ssh/sshd_config)
Well, I'm not sure. I got the impression that the default ssh server configuration allows access from the Internet. Here are some quotes from Ubuntu documentation. Have I got the wrong end of the stick?
Because a lot of people with SSH servers use weak passwords, many online
attackers will look for an SSH server, then start guessing passwords at
random.
and
Finally, try logging in from another computer elsewhere on the Internet -
perhaps from work (if your computer is at home) or from home (if your
computer is at your work).
Likely the reason this doesn't work, is because nss-mdns does not resolve reverse DNS for IP addresses other than the link local range (169.254.0.0/16). This is by design and per-spec. So this will never work.