2011-07-20 38 views
7

我已經在這裏閱讀了GitHub的相關問題,但是找不到解決問題的線索。我已經創造了新的git回購和現在我試圖把它推到GitHub上:git push origin master:錯誤:斷開連接:沒有支持的驗證方法可用

git remote add origin [email protected]:clergyman/first_app.git 
git push origin master 

我得到:

FATAL ERROR: Disconnected: No supported authentication methods available 
fatal: The remote end hung up unexpectedly 

ssh [email protected]工作正常。
我在32位Windows 7上運行。
GitHub全局設置也很好。有任何想法嗎?

+1

令人驚訝的我找到了解決辦法,所以我把它放在這裏。整個問題是因爲當試圖通過SSH(> git push origin master)建立連接時,git試圖使用PUTTY,當> ssh [email protected]時,它使用ssh客戶端,它使用git install package。所以對我來說,以下方面有所幫助:我重新安裝了git,當嚮導問什麼ssh客戶端使用時,我這次檢查了OpenSSH!所以,膩子出現了萬惡之源。祝大家好運。 – Clergyman

+1

使用HTTPS推送。這樣更容易。 –

回答

5

該解決方案以某種方式將git的默認ssh客戶端從pegeant更改爲openSsh。例如。重新安裝git並在相應的窗口中檢查openSSH(不是pegeant或其他東西),如果你剛剛安裝了git並且還沒有開始工作。

+0

在源代碼樹中,這個設置是General-> SSH client configuration-> select OpenSSH –

2

莫非部分"No supported authentication methods available" on GitHub幫助呢?

You should be aware of the environment variable GIT_SSH , which is used by git to find your ssh-speaking client, if ssh doesn’t work for you.
The git install may be using plink.exe (via GIT_SSH) to perform the authentication.
If so, make sure you have pageant.exe running, and the key you created for github loaded into it. This provides the key to plink.exe ; without it, the above error will occur.

See this post for a longer discussion.

+0

謝謝,它不是關於環境變量或什麼的,而是關於膩子的怪異。我將pegeant改爲OpenSSH作爲默認的ssh客戶端,並開始正常工作。 – Clergyman

+0

對我來說這太複雜了,用膩子來解決這個問題,導致另一個問題,等等。爲什麼我應該讓git和其他一些客戶端一起工作,如果包裏有熟悉的並準備好工作的話,我的意思是openSSH? – Clergyman

5

我跑進了64位工作的Windows 7相同的錯誤消息試圖讓Git的,Git的擴展和GitHub上我能夠同時繼續使用膩子來解決問題。

我創建了下的的.profile文件:用以下內容\用戶\ MyUserName輸入

GIT_SSH="/c/Program Files (x86)/Git/bin/ssh.exe" 

不得不使用git慶典中 「觸摸.profile文件」 創建自Windows文件GUI對於嘗試創建以句點開頭的文件來譴責你。

不能信用。我只是在提供的答案here上放了一個窗口旋轉。

+0

我想這是同一解決方案的變體 - 指定默認的git客戶端的路徑。 – Clergyman

5

當我選擇plink.exe執行認證,這裏是我的步驟

  1. 使用「puttygen.exe」生成公鑰和私鑰,並保存在膩子專用密鑰文件格式私鑰( filename.ppk)。
  2. 將在「puttygen.exe」中生成的公鑰粘貼到github賬戶設置中。
  3. 啓動pageant.exe(膩子認證代理),而今天使用TortoiseGit添加步生成私鑰1.
+0

woohoo謝謝 – Anicho

0

我的同事有這樣的錯誤突然出現在他身上。他無意中將他的Putty私鑰文件(myprivatekey.ppk)移到了另一個文件夾中。所以確保私鑰文件的路徑是正確的。在TortoiseGit中,轉到設置... Git ...遠程。見下圖:

enter image description here

相關問題