- 1.设置root用户密码
shell
sudo passwd root- 2.修改sshd_config文件
shell
sudo vim /etc/ssh/sshd_config修改下面配置
text
#PermitRootLogin prohibit-password
#PasswordAuthentication yes为
text
PermitRootLogin yes
PasswordAuthentication yes- 3.重启ssh服务
shell
sudo service sshd restart