编辑/etc/ssh/sshd_config将PasswordAuthentication参数值修改为no: PasswordAuthentication no重启ssh服务:systemctl restart sshd.service