无法通过ssh git clone bitbucket

问题描述

我已经创建了公钥和私钥,并将公钥添加到Bitbucket存储库中。

enter image description here

这些私钥/公钥对位于我希望克隆到的用户帐户的.ssh文件夹中。

enter image description here

尝试使用SSH克隆会导致连接被拒绝:

enter image description here

这使我相信Bitbucket项目/服务器未配置为ssh,或者这可能是我公司网络的防火墙/端口问题。但是,端口7999和端口22是开放的。

enter image description here

这使我研究了使用ssh进行克隆的其他方法,但是可以按此处所述通过http进行克隆(以防端口22或7999被阻止):https://support.atlassian.com/bitbucket-cloud/docs/troubleshoot-ssh-issues/ 

为此,我如下修改了ssh配置:

enter image description here

这样做可以让我至少与bitbucket建立连接,但这就像请求很糟糕一样:

enter image description here

这使我相信也许我未正确签署证书,所以我尝试了以下方法:https://unix.stackexchange.com/questions/503851/how-to-generate-a-certificate-file-which-to-be-used-with-ssh-config 

添加ssh配置中提供的证书文件。听起来我需要添加用于签署用户密钥(生成证书)的私钥的公钥。但是,我将无法访问bitbucket服务器上可用证书的私钥。

另外,我能够从altssh.bitbucket.di2e.net:443上获取公共证书,并且我确实尝试过使用它,但是仍然收到了错误的请求...自此以来,使用此方法可能没有任何意义是PEM格式,但我认为值得尝试。

openssl s_client connect altssh.bitbucket.di2e.net:443 < /dev/null | sed -ne '/-BEGIN CERTIFICATE/,/END CERTIFICATE/p' > public.crt

我想知道我是否使用cert密钥对用户密钥进行了错误签名,但是想建议执行此操作的最佳步骤。

谢谢!

解决方法

来查找我尝试连接的bitbucket代理服务器时,未将其配置为处理altssh.bitbucket.di2e.net,这导致通过:443的连接被断开。

问题的根源是公司防火墙将7999阻止到外部(而不是内部阻止),以及我尝试克隆为未配置为{{1的远程计算机上的/etc/ssh/sshd_config }}

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...