首页 > SSH连接不上

SSH连接不上

ssh server: 172.31.72.25 port:222
ssh client: 172.31.72.20

在服务器端ssh连接是没有问题的。
但在客户端执行命令ssh -p 222 172.31.72.25
出现Connection closed by 172.31.72.25 没有其它错误信息。
执行ssh -p 222 172.31.72.25 -v 查看debug1的信息 如下:
OpenSSH_4.3p2, OpenSSL 0.9.8e-fips-rhel5 01 Jul 2008
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug1: Connecting to 172.31.72.25 [172.31.72.25] port 222.
debug1: Connection established.
debug1: permanently_set_uid: 0/0
debug1: identity file /root/.ssh/identity type -1
debug1: identity file /root/.ssh/id_rsa type -1
debug1: identity file /root/.ssh/id_dsa type -1
debug1: loaded 3 keys
debug1: Remote protocol version 2.0, remote software version OpenSSH_6.6
debug1: match: OpenSSH_6.6 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_4.3
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-cbc hmac-md5 none
debug1: kex: client->server aes128-cbc hmac-md5 none
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192) sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
Connection closed by 172.31.72.25
在google百度了好久也没有得到正确解答,还望各位大神能给一个意见,谢谢!


1、先确认一下网络和路由是否连通,ping是否有回应。
2、服务器端是否开启了访问控制,比如不允许本地外的ip访问或只允许指定范围的IP地址访问。


第一网络肯定是通的,
第二肯定是222端口。。
那谁就别乱说端口错了。
端口错了肯定不会出现debug信息“debug1: Connection established.”

又因为是IP段,
感觉是机房网络出问题了。
机房防火墙什么的,不好排查。


顶1楼。
然后你可以尝试下telnet 是否有相应呢

【热门文章】
【热门文章】