簡體   English   中英

無法連接到github,但其他git repos,bitbucket和ssh都可以正常工作

[英]Cannot connect to github but other git repos, bitbucket and ssh do work fine

當我嘗試克隆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

不知道為什么這個問題被否決了。

這就是我解決此問題的方法:

這里有更多詳細信息https://github.com/desktop/desktop/issues/4105

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM