![Xshell连接不上虚拟机&连接提示SSH服务器拒绝了密码,请再试一次 Xshell连接不上虚拟机&连接提示SSH服务器拒绝了密码,请再试一次](https://image.shishitao.com:8440/aHR0cHM6Ly9ia3FzaW1nLmlrYWZhbi5jb20vdXBsb2FkL2NoYXRncHQtcy5wbmc%2FIQ%3D%3D.png?!?w=700&webp=1)
问题1:Xshell连接不上虚拟机
#启动ssh服务
/etc/init.d/ssh start
#查看SSH服务22端口是否开启
netstat -antulp | grep ssh
问题2:XShell连接Linux提示ssh服务器拒绝了密码,请再试一次
原因:一般是设置了禁止root远程登录。
vim /etc/ssh/sshd_config
将下列配置
# Authentication:
LoginGraceTime 120
PermitRootLogin prohibit-password
StrictModes yes
修改为
# Authentication:
LoginGraceTime 120
PermitRootLogin yes
StrictModes yes
参考:https://blog.csdn.net/fanren224/article/details/70862346