当我尝试克隆github存储库时,我得到了
Couldn't agree a key exchange algorithm (available: curve25519-sha256@libssh.org,ecdh-sh
a2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521)
如果我从私人存储库或我的bitbucket帐户尝试git clone
,它可以正常工作。
我在Windows7 64上。我使用 pageant 作为ssh代理。我在GIT_SSH环境变量中尝试过TortoisePlink.exe和plink.exe(这一个https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html)。
我对这个配置和这个ssh密钥没有任何问题,直到我格式化并重建了我的电脑。
我已尝试在我的github帐户中删除并重新添加密钥,并且我尝试使用rsa 1024,rsa 4096和ed25519密钥。
我正在运行git windows bash。我也尝试过使用phpstorm UI,结果相同。
如果我尝试使用TortoisePlink.exe,就会发生这种情况(另外,我会看到一个上面提到的错误的弹出窗口):
$ git clone git@github.com:foothing/laravel-gdpr-consent.git
Cloning into 'laravel-gdpr-consent'...
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
如果我尝试使用plink.exe,就会发生这种情况:
$ git clone git@github.com:foothing/laravel-gdpr-consent.git
Cloning into 'laravel-gdpr-consent'...
The server's host key is not cached in the registry. You
have no guarantee that the server is the computer you
think it is.
The server's rsa2 key fingerprint is:
ssh-rsa xx:xx:xx
If you trust this host, enter "y" to add the key to
PuTTY's cache and carry on connecting.
If you want to carry on connecting just once, without
adding the key to the cache, enter "n".
If you do not trust this host, press Return to abandon the
connection.
Store key in cache? (y/n)
我点击了y没有任何反应(我相信git和plink之间的输入处理会发生一些奇怪的事情)
如果我尝试通过ssh连接到github,我会得到以下内容
$ ssh git@github.com
key_load_public: invalid format
Warning: Permanently added the RSA host key for IP address 'x.x.x.x' to the list of known hosts.
Enter passphrase for key '/foo/bar/.ssh/id_rsa':
PTY allocation request failed on channel 0
Hi brazorf! You've successfully authenticated, but GitHub does not provide shell access.
Connection to github.com closed.
Git版本:
$ git --version
git version 2.16.2.windows.1
答案 0 :(得分:0)
不知道为什么这个问题被低估了。
这就是我解决这个问题的方法: