Linux Xshell连接不到虚拟机 — Could not connect to ‘xxx.xxx.xxx.xxx‘ (port 22): Connection failed
前言
本来用Xshell连的好好的,突然有一天就不行了QAQ,网上搜的各种方法都试了就是不行,最后乱蒙成功,下面分享一下我都用了哪些方法,还有最后一次使用的方法~~
解决方式
1、在VMware中检查虚拟机网络,看是否已经连接
2、win+R->cmd ping http://xxx.xxx.xxx.xxx(目标ip,也就是Xshell中连接系统的ip),检查虚拟机端口是否能ping通,如果不能则是Linux系统网络与外界连接的问题
3、检查本机是否开启DHCP服务,直接使用windows的网络诊断服务,在诊断结束后,如果未开启DHCP服务,系统会自动帮忙开启,以下是win10的操作:
右下角网络图标->打开网络设置->更改适配器选项->在VMnet中右键选择诊断(如下图)




4、进入Linux系统终端,检查网卡是否全部启动,要用到的指令和图解如下
ifconfig -a // 查看所有可用网卡
ifconfig // 查看已启动的网卡信息
ifconfig xxx up // 启动xxx网卡
sudo ifconfig xxx up // 启动需要提权的xxx网卡








5、关闭本机防火墙
6、更换Xshell连接使用的IP地址
最终,我想了下换一个ip进行连接,就使用上图ens33网卡,inet6后面的ip地址(如果有inet信息,直接用inet后面的ip地址),在Xshell中重新建立一个连接会话,终于看到了连接成功




希望我的分享能帮到你~~如果觉得有用可以三连支持一手OVO,转载自我的CSDN博客梦想是优秀社畜
2024最新激活全家桶教程,稳定运行到2099年,请移步至置顶文章:https://sigusoft.com/99576.html
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请联系我们举报,一经查实,本站将立刻删除。 文章由激活谷谷主-小谷整理,转载请注明出处:https://sigusoft.com/6975.html