Порядок секций тоже важен.
Так не работает:
PermitRootLogin no
PasswordAuthentication yes
MaxAuthTries 1
Match user "*root"
PasswordAuthentication no
Match user "*root" address 192.168.35.0/24
PasswordAuthentication yes
PermitRootLogin without-password
(первый match срабатывает всегда, второй никогда)
Так работает:
PermitRootLogin no
PasswordAuthentication yes
MaxAuthTries 1
Match user "*root" address 192.168.35.0/24
PasswordAuthentication yes
PermitRootLogin without-password
Match user "*root"
PasswordAuthentication no
(Из локальной сети могу подключиться по SSH и под рутом и под как-бы-рутом, под рутом только по ключу, под как-бы - по паролю и ключу, из интернета - только под как-бы и только по ключу.)