SSH服务器拒绝了密码,xshell连不上虚拟机怎么办

用Xshell链接虚拟机的时候,出现下面情况:

这是sshd的设置不允许root用户用密码远程登录

解决方案:

修改 vim /etc/ssh/sshd_config

找到# Authentication:
LoginGraceTime 120
PermitRootLogin without passwd
StrictModes yes

改成

# Authentication:
LoginGraceTime 120
PermitRootLogin yes
StrictModes yes

重启虚拟机

原文地址:https://www.cnblogs.com/qiaodan/p/6123205.html