禁止密码,仅使用证书登入
# 禁用密码及交互式认证
PasswordAuthentication no
ChallengeResponseAuthentication no
UsePAM no
# 强制仅用公钥登录
PubkeyAuthentication yes
AuthorizedKeysFile .ssh/authorized_keys
# 针对 root 也只允许公钥登录
PermitRootLogin prohibit-password
# 可选:禁止空口令(一般默认为 no)
PermitEmptyPasswords no