现在的位置: 首页 > 综合 > 正文

ssh出现connection timeout

2017年12月15日 ⁄ 综合 ⁄ 共 723字 ⁄ 字号 评论关闭

有时候ssh到一个机子的时候,等了一会儿,出现connection timeout,但是并不清楚到底是哪里出错了。

我们可以有几个好的办法确定是哪里出了问题。


第一,先ping你的机子,如果不能ping通,考虑网络是否是断的。但是如果不能ping通,有可能是机子设置了相应的不回复icmp的ping报文等,也不能完全作为判断依据。

第二,如果你用的域名,可以换成IP,试试IP能不能ping通,如果IP可以ping通,那么就是DNS的问题。

第三,可以使用ssh进行debug,加上-v的选项,来看看执行到哪一步了,比如出现:

OpenSSH, OpenSSL 1.0.1 14 Mar 2012
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug1: Connecting to www.hongchangfirst.com [192.168.43.83] port 22.
debug1: connect to address 192.168.43.83 port 22: No route to host
ssh: connect to host www.hongchangfirst.com port 22: No route to host


出现这种情况,一般是因为这个IP不可达造成的。

原文:http://blog.csdn.net/hongchangfirst/article/details/37529507

作者:hongchangfirst

hongchangfirst的主页:http://blog.csdn.net/hongchangfirst

抱歉!评论已关闭.