使用opc用户,密钥登录系统以后
1、执行如下命令
sudo -i
切换为root用户
2、接着输入
echo root:88886666|sudo chpasswd 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;
88886666为root用户新设置的服务器登录密码
3、重启sshd服务
sudo service sshd restart