git – bibucket ssh_exchange_identification:读取:由peer重置连接

我正在尝试为bitbucket设置无密码git连接.我在Windows Server 2008上使用git bash.

通过HTTPS克隆工作正常:

nskoric@P8-DEV /z/test
$git clone https://dijxtra@bitbucket.org/nek-plan/gittest.git
Cloning into 'gittest'...
Password for 'https://dijxtra@bitbucket.org':
remote: Counting objects: 3, done.
remote: Total 3 (delta 0), reused 0 (delta 0)
Unpacking objects: 100% (3/3), done.
Checking connectivity... done.

但是,HTTPS是不可接受的,因为我需要无密码登录.所以我生成了一个私钥/公钥对,上传了公钥到bitbucket并在.ssh / config中设置了Host / IdentitiyFile.然后我尝试连接并失败了.

端口22在我的公司防火墙上关闭:

nskoric@P8-DEV /z/test
$ssh git@bitbucket.org -vv
OpenSSH_6.6.1, OpenSSL 1.0.1i 6 Aug 2014
debug1: Reading configuration data /u/.ssh/config
debug1: /u/.ssh/config line 1: Applying options for *bitbucket.org
debug2: ssh_connect: needpriv 0
debug1: Connecting to bitbucket.org [131.103.20.168] port 22.

所以,我正在使用端口443,根据bitbucket文档:

nskoric@P8-DEV /z/test
$git clone ssh://git@altssh.bitbucket.org:443/nek-plan/gittest.git
Cloning into 'gittest'...
ssh_exchange_identification: read: Connection reset by peer
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

我试过谷歌搜索“bitbucket ssh_exchange_identification:读取:连接重置由同行”,但它没有帮助: – /然后我尝试调试SSH连接,但这是我得到的最远:

nskoric@P8-DEV /z/test
$ssh git@altssh.bitbucket.org -p 443 -vv
OpenSSH_6.6.1, OpenSSL 1.0.1i 6 Aug 2014
debug1: Reading configuration data /u/.ssh/config
debug1: /u/.ssh/config line 1: Applying options for *bitbucket.org
debug2: ssh_connect: needpriv 0
debug1: Connecting to altssh.bitbucket.org [131.103.20.174] port 443.
debug1: Connection established.
debug1: identity file /u/.ssh/bitbucketnek type 1
debug1: identity file /u/.ssh/bitbucketnek-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_6.6.1
ssh_exchange_identification: read: Connection reset by peer

所以,SSH找到了正确的身份文件(/u/.ssh/bitbucketnek),然后就死了.现在,如果我能够弄清楚问题是否在我的“bitbucketnek”私钥中,或者是我们公司防火墙中的问题,还是第三种问题,那将会非常有用.有任何想法吗?

谢谢!

最佳答案
作为一个有用的注释,我在共享托管环境,特别是GoDaddy,以及它给我这个错误的原因:

ssh_exchange_identification: read: Connection reset by peer

解决方案:我的本地计算机的IP已被GoDaddy阻止,所以我不得不联系他们的支持,向他们发送运行错误输出的屏幕截图:

ssh -v user@domain

,并为他们提供我的IP.他们注意到我的ip实际上已被阻止,删除它,问题解决了.

转载注明原文:git – bibucket ssh_exchange_identification:读取:由peer重置连接 - 代码日志