1、 登录控制台
2、输入"sudo -i",切换到root角色
3、输入"vi /etc/ssh/sshd_config",编辑sshd_config文件
4、 将PermitRootLogin no(在文件上部分)修改为PermitRootLogin yes
将PasswordAuthentication no(在文件下部分)修改为PasswordAuthentication yes
5、 保存文件
6、为root用户添加密码
输入“passwd root”
扫描二维码关注公众号,回复:
6529921 查看本文章
7、重启ssh服务
centos7的命令:"systemctl restart sshd"
8、xshell 使用root+密码登录即可