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


当前回答

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

其他回答

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

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

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

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

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

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

我的电脑在连接到Github时无法连接22端口。我用bitbucket从来没有这个问题。如果你同时拥有GitHub和bitbucket

Host bitbucket.org
Hostname  altssh.bitbucket.org
Port  443


Host github.com
Hostname ssh.github.com
Port 443

ref

它基本上在443端口连接SSH,而不是22端口。