1. 秘钥登录成功
  • ssh客户端执行:
sudo -i
passwd
  • 两次确认密码
  1. 执行以下指令允许root用户远程登录
sudo sed -i 's/^#\?PermitRootLogin.*/PermitRootLogin yes/g' /etc/ssh/sshd_config;
sudo sed -i 's/^#\?PasswordAuthentication.*/PasswordAuthentication yes/g' /etc/ssh/sshd_config;
sudo service sshd restart

参考文章: