Xshell:Could not connect to '10.10.10.135' (port 22): Connection failed.

小白记录:
xshell 和 navicat 连接CentOS 7时报错

Could not connect to ‘10.10.10.135’ (port 22): Connection failed.
2003-can’t connect to mysql server on ‘10.10.10.135’

首先,Xshell之前可以连接CentOS7,检查了一下ssh有没有开启(如果没有就请先安装openssh-server服务,在终端中输入 yum list installed | grep openssh-server)

[root@localhost ~]# ps -e | grep sshd
   826 ?        00:00:00 sshd
  1174 ?        00:00:00 sshd
  1204 ?        00:00:00 sshd

再检查22端口有无打开

[root@localhost ~]# netstat -an | grep 22
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN     
tcp        0     36 10.10.10.135:22         10.10.10.1:53341        ESTABLISHED
tcp        0      0 10.10.10.135:22         10.10.10.1:52930        ESTABLISHED
tcp6       0      0 :::22                   :::*                    LISTEN     
unix  3      [ ]         STREAM     CONNECTED     17822  

端口也是正常打开的,最后大概就是我做数据库的配置,导致虚拟机本身出现了问题,还原虚拟网卡的配置即可(记得备注一下你的网卡信息,网关什么的):
在这里插入图片描述在这里插入图片描述
最后还原后输入ifconfig或ip add查看地址是否还原(如果虚拟机的ip地址没有设置成静态可能会有所变化)

发布了6 篇原创文章 · 获赞 0 · 访问量 86

猜你喜欢

转载自blog.csdn.net/qq_42091101/article/details/104134093