限制ssh只能用证书登录

要限制ssh只能用key登录只需修改/etc/ssh/sshd_config文件以下参数即可:
ChallengeResponseAuthentication no
PasswordAuthentication no

然后service ssh restart