天天看點

xshell連接配接時報錯:Could not connect to \'192.168.2.125\' (port 22): Connection failed.

解決思路:

1.首先用主機ping下虛拟機IP,看是否能ping通

2.如果ping不通就看虛拟機防火牆是否開啟,service iptables status

[root@mysql ~]# service iptables status

iptables: Firewall is not running.

上圖提示,防火牆才是關閉狀态,如果不是上面提示,就執行指令

service iptables stop(臨時關閉防火牆)

chkconfig iptables off(永久關閉防火牆)

3.如果排除了防火牆問題,可以重新開機下VMware,虛拟機.

4.最後如果都行不通的話,我試了試從另一個虛拟機(192.168.2.123)可以ssh連接配接此虛拟機(192.168.2.125)

  而且xshell可以連接配接到192.168.2.123,也可以ping通192.168.2.125,但就是用xshell連不上192.168.2.125

  最終換了個IP,(把192.168.2.125換成192.168.2.152)問題解決,把192.168.2.152