这里xshell用的是ssh连接,所以问题一定出在ssh配置文件上!

xshell连接虚拟机,出现SSH服务拒绝密码

 

vi /etc/ssh/sshd_config

修改配置

sshd_config文件,注意ssh_config是针对客户端的配置文件,而sshd_config是针对服务器端的配置文件

# Authentication:

LoginGraceTime 120

PermitRootLogin without passwd

StrictModes yes

改成

# Authentication:

LoginGraceTime 120

PermitRootLogin yes

StrictModes yes

 

重启ssh

systemctl restart sshd

重启虚拟机

reboot

xshell再次连接即可

 

相关文章: