首先用预先设置好的密钥登录
然后

1、修改ROOT密码
sudo passwd root

2、sudo chmod 777 /etc/ssh/sshd_config
用完再把权限改回来

3、vim /etc/ssh/sshd_config
PermitRootLogin
这行改为
PermitRootLogin yes
PasswordAuthentication no
上面的no改为yes
UsePAM yes
上面的yes改为no

4、sudo chmod 644 /etc/ssh/sshd_config

5、reboot 重启VPS,就可以使用root正常登陆了