github ssh方式交互遇到的一个ssh_exchange_identification: read: Connection reset by peer

2016-09-23 01:32:00
hainuo
原创 5789
#0x01 问题出现想要使用方便的方式来访问github,忽然出现这样的bug```➜ ~ ssh -vT git@github.com OpenSSH_7.3p1, OpenSSL 1.0.2i 22 Sep 2016debug1: Reading configuration data /usr/local/etc/ssh/ssh_configdebug1: /usr/local/etc/ssh/ssh_config line 51: Applying options for *debug1: Connecting to github.com [x.x.x.x] port 22.debug1: Connection established.debug1: identity file /Users/hainuo/.ssh/id_rsa type 1debug1: key_load_public: No such file or directorydebug1: identity file /Users/hainuo/.ssh/id_rsa-cert type -1debug1: key_load_public: No such file or directorydebug1: identity file /Users/hainuo/.ssh/id_dsa type -1debug1: key_load_public: No such file or directorydebug1: identity file /Users/hainuo/.ssh/id_dsa-cert type -1debug1: key_load_public: No such file or directorydebug1: identity file /Users/hainuo/.ssh/id_ecdsa type -1debug1: key_load_public: No such file or directorydebug1: identity file /Users/hainuo/.ssh/id_ecdsa-cert type -1debug1: key_load_public: No such file or directorydebug1: identity file /Users/hainuo/.ssh/id_ed25519 type -1debug1: key_load_public: No such file or directorydebug1: identity file /Users/hainuo/.ssh/id_ed25519-cert type -1debug1: Enabling compatibility mode for protocol 2.0debug1: Local version string SSH-2.0-OpenSSH_7.3ssh_exchange_identification: read: Connection reset by peer``````➜ ~ git clone git@github.com:hainuo/weaseclient.gitCloning into 'weaseclient'...ssh_exchange_identification: read: Connection reset by peerfatal: Could not read from remote repository.Please make sure you have the correct access rightsand the repository exists.```这个怎么破???????十万只xxxx奔腾啊#0x02 重装mac到10.11.6```➜ ~ ssh -vT git@github.comOpenSSH_7.3p1, OpenSSL 1.0.2i 22 Sep 2016debug1: Reading configuration data /usr/local/etc/ssh/ssh_configdebug1: /usr/local/etc/ssh/ssh_config line 51: Applying options for *debug1: Connecting to github.com [192.30.253.113] port 22.debug1: Connection established.debug1: identity file /Users/hainuo/.ssh/id_rsa type 1debug1: key_load_public: No such file or directorydebug1: identity file /Users/hainuo/.ssh/id_rsa-cert type -1debug1: key_load_public: No such file or directorydebug1: identity file /Users/hainuo/.ssh/id_dsa type -1debug1: key_load_public: No such file or directorydebug1: identity file /Users/hainuo/.ssh/id_dsa-cert type -1debug1: key_load_public: No such file or directorydebug1: identity file /Users/hainuo/.ssh/id_ecdsa type -1debug1: key_load_public: No such file or directorydebug1: identity file /Users/hainuo/.ssh/id_ecdsa-cert type -1debug1: key_load_public: No such file or directorydebug1: identity file /Users/hainuo/.ssh/id_ed25519 type -1debug1: key_load_public: No such file or directorydebug1: identity file /Users/hainuo/.ssh/id_ed25519-cert type -1debug1: Enabling compatibility mode for protocol 2.0debug1: Local version string SSH-2.0-OpenSSH_7.3debug1: Remote protocol version 2.0, remote software version libssh-0.7.0debug1: no match: libssh-0.7.0debug1: Authenticating to github.com:22 as 'git'debug1: SSH2_MSG_KEXINIT sentdebug1: SSH2_MSG_KEXINIT receiveddebug1: kex: algorithm: curve25519-sha256@libssh.orgdebug1: kex: host key algorithm: ssh-rsadebug1: kex: server->client cipher: chacha20-poly1305@openssh.com MAC: compression: nonedebug1: kex: client->server cipher: chacha20-poly1305@openssh.com MAC: compression: nonedebug1: expecting SSH2_MSG_KEX_ECDH_REPLYdebug1: Server host key: ssh-rsa SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8debug1: Host 'github.com' is known and matches the RSA host key.debug1: Found key in /Users/hainuo/.ssh/known_hosts:1debug1: rekey after 134217728 blocksdebug1: SSH2_MSG_NEWKEYS sentdebug1: expecting SSH2_MSG_NEWKEYSdebug1: rekey after 134217728 blocksdebug1: SSH2_MSG_NEWKEYS receiveddebug1: SSH2_MSG_SERVICE_ACCEPT receiveddebug1: Authentications that can continue: publickeydebug1: Next authentication method: publickeydebug1: Offering RSA public key: /Users/hainuo/.ssh/id_rsadebug1: Server accepts key: pkalg ssh-rsa blen 279debug1: Authentication succeeded (publickey).Authenticated to github.com ([192.30.253.113]:22).debug1: channel 0: new [client-session]debug1: Entering interactive session.debug1: pledge: networkdebug1: client_input_channel_req: channel 0 rtype exit-status reply 0Hi hainuo! You've successfully authenticated, but GitHub does not provide shell access.debug1: channel 0: free: client-session, nchannels 1Transferred: sent 2664, received 1776 bytes, in 0.8 secondsBytes per second: sent 3372.3, received 2248.2debug1: Exit status 1```卧槽,什么情况难道必须重装才行。心里还是很高兴,没白装,2个小时也不是白装的,还要加上各个软件xcode 下载。。。。。。 一晚上就一晚上吧 #0x03 brew安装完毕 使用的 openssl为基础的openssh 7.3p1问题又出现了```....ssh_exchange_identification: read: Connection reset by peer```什么情况。#0x04 各种百度/谷歌/sf.gg卧槽,sf.gg 赶紧发个帖子问问![](https://blog.hainuo.info/data/upload/201609/f_7c048bb9f1e1807fca807419fdab8d10.png)于是就找到这个帖子https://segmentfault.com/q/1010000004993125#0x05 找到问题原来就是科学上网惹的祸。。科学上网ip地址被解析至 ```Name:github.comAddress: 202.x.x.x```而不翻墙地址是```Name:github.comAddress: 192.30.253.113```就是这两个地址的不同导致 `ssh -vT git@github.com` 和 所有的`github ssh`操作被拒绝
发表评论
肆 加 贰 =
评论通过审核后显示。