Xshell连接VMware虚拟机连接不上怎么解决

1、密码错误

 建议重装,最为简单

2、ip配置有问题

解决办法:重新固定或修改IP

           [root@rhce ~]# nmcli c modify ens160 ipv4.addresses 192.168.220.131/24 ipv4.gateway 192.168.220.2 ipv4.dns 114.114.114.114 ipv4.method manual autoconnect yes
           [root@rhce ~]# nmcli c up ens160

3、VMware中ssh不允许连接

解决办法

[root@rhce ~]# cd /etc/ssh
[root@rhce ssh]# ls -l
total 600
-rw-r--r--. 1 root root     578094 Sep 23  2022 moduli
-rw-r--r--. 1 root root       1921 Sep 23  2022 ssh_config
drwxr-xr-x. 2 root root         28 Sep 23 00:14 ssh_config.d
-rw-------. 1 root root       3667 Sep 23  2022 sshd_config
drwx------. 2 root root         28 Sep 23 00:16 sshd_config.d
-rw-r-----. 1 root ssh_keys    492 Sep 23 11:48 ssh_host_ecdsa_key
-rw-r--r--. 1 root root        162 Sep 23 11:48 ssh_host_ecdsa_key.pub
-rw-r-----. 1 root ssh_keys    387 Sep 23 11:48 ssh_host_ed25519_key
-rw-r--r--. 1 root root         82 Sep 23 11:48 ssh_host_ed25519_key.pub
-rw-r-----. 1 root ssh_keys   2578 Sep 23 11:48 ssh_host_rsa_key
-rw-r--r--. 1 root root        554 Sep 23 11:48 ssh_host_rsa_key.pub

[root@rhce ssh]# vim sshd_config

找到  #PermitRootLogin prohibit-password 

并将其修改为  PermitRootLogin yes

重启ssh服务  [root@rhce ssh]# systemctl restart sshd

再重新连接即可解决
 

  • 4
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值