Answers:
使用Match块在最后的/etc/ssh/sshd_config:
# Global settings
…
PasswordAuthentication no
…
# Settings that override the global settings for matching IP addresses only
Match address 192.0.2.0/24
    PasswordAuthentication yes
然后告诉sshd服务重新加载其配置:
service ssh reload
sshd_config是缩进的,但不是Python;)
                    Match块将一直扩展到下一个Match指令或文件的末尾。这就是为什么您必须将其放在最后。
                    你可以加:
AllowUsers user1@192.168.*.*, user2@192.168.*.*
这更改了默认行为,实际上拒绝了来自所有主机的所有其他用户。匹配块在OpenSsh 5.1版及更高版本中可用。
man sshd_config,其AllowGroups工作方式与相同AllowUsers,但AllowUsers似乎优先于AllowGroups。