
- 登录后进入Root
sudo -i
- 设置Root密码
echo root:Vicer |sudo chpasswd root 或
passwd 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 reboot