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”
7、重啟ssh服務
centos7的命令:"systemctl restart sshd"
8、xshell 使用root+密碼登錄即可