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


当前回答

在.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

其他回答

刷新我的网络连接对我很有效。

此外,如果你使用移动热点-重新启动移动设备是解决方案在我的情况下。

我在我的服务器上有这个问题,它是用常规IP和故障转移IP设置的。此时,故障转移IP没有指向服务器。我必须从/etc/netplan/01-netcfg.yaml中的服务器配置中删除故障转移IP。将故障转移IP指向该服务器也可能解决了这个问题。

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

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

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

好试试这个ssh -T -p 443 git@ssh.github.com而不是ssh -T git@github.com

在.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