我在代理下,我在相当长的一段时间内成功地推进。 现在我突然不能进入git了。 我已经设置了RSA密钥和代理,并仔细检查了它们,没有效果,git抛出了页面标题中显示的错误。


当前回答

将repo url从ssh更改为https对我来说没有多大意义。因为我更喜欢ssh而不是https,因为我不想放弃一些额外的好处。以上答案都很好,也很准确。如果你在GitLab遇到这个问题,请去他们的官方文档页面,并像那样修改你的配置文件。

Host gitlab.com
  Hostname altssh.gitlab.com
  User git
  Port 443
  PreferredAuthentications publickey
  IdentityFile ~/.ssh/gitlab

其他回答

在与Ludder类似的失败模式中,当我还没有登录到正确的公司VPN时,我就得到了这个错误。facepalm指:

对我来说,问题来自ISP方面。Internet服务提供商未启用端口号。所以让他们在我的网络上启用端口号,它开始工作。 仅用于测试:连接到移动热点并输入ssh -T git@bitbucket.org或git pull。 如果可以,请您的ISP启用该端口。

建议检查网络连接或重新连接。

为我解决这个问题的是在密钥文件上执行ssh-add。

ssh-add C:/Path/To/Key.pem

C: / Users / User / .ssh / config:

Host sshapp
    Hostname ssh.github.com
    IdentityFile C:/Path/To/Key.pem
    Port 443

然后克隆使用:

>git clone git@sshapp:<git_user>/app.git
Cloning into 'app'...
The authenticity of host '[ssh.github.com]:443 ([140.82.121.35]:443)' can't be established.
ED25519 key fingerprint is SHA256:+DiY3wvvV6T.....vCOqU.

在.ssh文件夹中 创建config文件

Host github.com
User git
Hostname ssh.github.com
PreferredAuthentications publickey
IdentityFile ~/.ssh/id_rsa
Port 443

Host gitlab.com
Hostname altssh.gitlab.com
User git
Port 443
PreferredAuthentications publickey
IdentityFile ~/.ssh/id_rsa