- 花样2016-03-01金牌会员86253
首先用预先设置好的密钥登录
然后1、修改ROOT密码
sudo passwd root2、sudo chmod 777 /etc/ssh/sshd_config
用完再把权限改回来3、vim /etc/ssh/sshd_config
PermitRootLogin
这行改为
PermitRootLogin yes
PasswordAuthentication no
上面的no改为yes
UsePAM yes
上面的yes改为no4、sudo chmod 644 /etc/ssh/sshd_config
5、reboot 重启VPS,就可以使用root正常登陆了