我在代理下,我在相当长的一段时间内成功地推进。 现在我突然不能进入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

其他回答

主要原因是公司最近安装的代理发生了变化,阻止了公司域以外的其他ssh连接。

我可以通过以下步骤成功连接:

仔细检查,这个问题是我所假设的 ssh -T git@github.com

它应该在一个超时中结束。

编辑本地远程URL

SSH配置——local -e

url = git@github。com: asheeshjanghu / Journal git。

to

url = https://github.com/asheeshjanghu/Journal.git

重要的一点是,在url中,你必须在2个地方改变。

从git@到https://,从github:username到github/username

最后通过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.

如果您在windows中,移动到您存储ssh密钥的目录,然后再试一次,这对我有用。

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