1. 设置root密码
$ sudo passwd root
根据提示输入密码
2. 切换到root用户
$ su - root
根据提示输入密码
3. 编辑 sshd_config
# vi /etc/ssh/sshd_config
原配置(是否注释和yes/no不一定完全配)
#PermitRootLogin yes
PasswordAuthentication no
修改后:
PermitRootLogin yes
PasswordAuthentication yse
4.重启sshd服务
service sshd restart
或
systemctl restart sshd.service
本文出现任何错误,请留言批评指正。