当我ping我的服务器,它回应:
user@localhost:~$ ping my.server PING my.server (111.111.111.11) 56(84) bytes of data. 64 bytes from my.server (111.111.111.11): icmp_req=1 ttl=42 time=38.4 ms 64 bytes from my.server (111.111.111.11): icmp_req=2 ttl=42 time=50.0 ms 64 bytes from my.server (111.111.111.11): icmp_req=3 ttl=42 time=58.6 ms ^C --- my.server ping statistics --- 3 packets transmitted,3 received,0% packet loss,time 2003ms rtt min/avg/max/mdev = 38.419/49.037/58.637/8.287 ms
但是当我尝试ssh(我总是做的事情,并且已经在过去几个小时在同一连接),它挂起:
user@localhost:~$ ssh my.server
speedtest.net说我的连接有1.5 Mbps下载和0.4 Mbps上传速度
有什么原因ssh挂?
答案中提供的建议的结果
从@ nsfyn55
user@localhost:~$ telnetmy.server 22 Trying 111.111.111.11... Connected to my.server Escape character is '^]'. SSH-2.0-OpenSSH_4.3 Connection closed by foreign host.
从@vahid:
user@localhost:~$ nc -v -w 1 111.111.111.111 -z 22 nc: timeout cannot be negative
ping(ICMP协议)和ssh是两种不同的协议。
>可能是ssh服务未运行或未安装
>防火墙限制(本地到服务器,如iptables或甚至sshd配置锁定)或(外部防火墙保护网络主机111.111.111.111的入侵流量)
首先检查是否ssh端口已启动
nc -v -w 1 111.111.111.111 -z 22
如果成功,那么ssh应该进行通信,否则它将永远不会工作,直到限制解除或ssh开始