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


当前回答

原因可能是防火墙修改,因为您处于网络中。(在这种情况下,他们可能会故意封锁一些端口) 再次确认这是否是原因…做

ssh -T git@github.com

这应该会超时。 如果是这种情况,使用http协议而不是ssh 只需将配置文件中的url更改为http。 方法如下:-

git config --local -e

变更分录

 url = git@github.com:username/repo.git

to

url = https://github.com/username/repo.git

其他回答

重启电脑帮我解决了这个问题。 Git版本:2.27.0.windows.1 操作系统版本:Windows 10

为我解决这个问题的是在密钥文件上执行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

所以我也遇到了同样的问题(不是在代理之后),然后遇到了这个问题。下面是我解决问题的方法:

尝试运行ssh -T git@github.com,它确实超时了,但是添加-o KexAlgorithms=ecdh-sha2-nistp521成功连接(从一个半相关问题的答案中找到)。

为了永久地解决这个问题,我只是在我的~/.ssh/config的github.com下添加了一行KexAlgorithms=ecdh-sha2-nistp521。现在一切似乎都正常了。

快速解决方法:尝试切换到不同的网络

我在热点(3/4G连接)时遇到了这个问题。切换到不同的连接(WiFi)解决了这个问题,但这只是一个变通办法——我没有机会深入了解问题的根源,所以其他答案可能更有趣,可以确定潜在的问题