- 修改sshd_config文件
vim /etc/ssh/sshd_config
将#PasswordAuthentication yes的注释去掉
将#PermitRootLogin prohibit-password的注释去掉 ,prohibit-password 改为yes
# Authentication:
LoginGraceTime 120
PermitRootLogin prohibit-password
改为
# Authentication:
LoginGraceTime 120
PermitRootLogin yes
StrictModes yes
- 重启服务
service ssh restart