修改配置文件
vi /etc/ssh/sshd_config
#PasswordAuthentication yes
改为
PasswordAuthentication no #改为禁用密码登录
重启ssh服务
systemctl restart sshd.service
vi /etc/ssh/sshd_config
#PasswordAuthentication yes
改为
PasswordAuthentication no #改为禁用密码登录
systemctl restart sshd.service