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百度了好久也没有得到正确解答,还望各位大神能给一个意见,谢谢!

阅读 7.7k
3 个回答

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

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

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进