SSH 限制特定网段登录
控制 root 密码登录,改成这样
nano /etc/ssh/sshd_config
# 全局默认:关闭密码登录,公钥证书开启
PasswordAuthentication no
PubkeyAuthentication yes
PermitRootLogin prohibit-password
# 白名单网段,放开密码登录
Match Address 192.168.100.0/24,192.168.101.0/24,192.168.111.0/24,192.168.112.0/24,172.16.0.0/12
PasswordAuthentication yes
PermitRootLogin yes
评论已关闭