2013-02-27 114 views
4

我已經建立了我的本地系統與GitHub一起工作如何在「Generating SSH Keys」方法中描述。致命:遠程端通過連接GitHub意外掛斷

關鍵文件和known_hosts已創建,公鑰已添加到GitHub帳戶,並且我收到消息「Hi ***!您已成功通過身份驗證,但GitHub不提供shell訪問權限。 「

enter image description here

但是我所有的努力做一些事情,有什麼需要與服務器的連接(編輯:有寫訪問) - 一個錯誤結束 - git的克隆,混帳推等:

fatal: The remote end hung up unexpectedly

編輯:

我可以克隆,但是隻能通過HTTP(https://github.com/account/reponame.git)或Git的只讀(GIT://github.com/account/reponame.git)。

編輯:

***@**** ~/.ssh 
$ ssh-add -l 
Could not open a connection to your authentication agent. 

雖然一個ssh劑守護程序(ssh-agent.exe)正在運行。

可能是這個問題。

+0

這很奇怪,因爲造成這種情況的最可能的原因是缺少SSH密鑰。 – gustavohenke 2013-02-27 03:43:30

回答

2

它的工作原理!

我已經開始了佳麗(膩子SSH認證代理),並加入我的PuTTY私鑰id_rsa.pkk它(與的puttygen(PuTTY密鑰生成)從id_rsa出口)。現在我可以寫回我的回購。

小怎麼到每個人,誰都有同樣的煩惱我:

0)建立本地系統與GitHub上,如何在「Generating SSH Keys」如何做descrided工作。

1)打開的puttygen,加載/導入(的OpenSSH)私鑰id_rsa和它(按鈕Save private key)(保存爲id_rsa.pkk在相同的文件夾,其中id_rsa被保存, - ~/.ssh)。您需要此密碼的PuTTY變體,用於通過Pageant和(如果您使用它)TortoiseGit進行PuTTY驗證。

enter image description here

2A)打開佳麗(我的電腦上它的C:\Program Files (x86)\PuTTY\pageant.exe),並添加膩子私鑰。或者只需打開PuTTY私鑰文件(id_rsa.pkk)與Pageant

2B)爲TrtoiseGit我只設置SSH clientC:\Program Files (x86)\Git\bin\ssh.exe)在全球TrtoiseGit設置。

enter image description here

就是這樣。

I've got it working, but I don't have a deep understanding of this thema and cannot provide a low level explanation of the solution and the causes of this problem (and e.g why it was working in some clients and wasn't in some others). So feel free to edit/comment this post, if you can explain all this better.

+0

看起來不錯,比我的回答更完整。 +1 – VonC 2013-02-28 13:34:47

2

如該錯誤信息彈出,而你的SSH密鑰被正確地記錄GitHub的唯一實例,當

  • 嘗試克隆回購與錯案或不適當的SSH URL。
    它應該是:
git clone [email protected]:user/repo.git
  • 嘗試克隆,而您沒有寫訪問(公共回購),或任何接入(私人回購)回購。
    從GitHub的頁面 「Which remote URL should I use?

To use these URLs, you must have write access to a public repo or any access to a private repo.
These URLs will not work with a public repo you do not have write access to.

  • 私鑰密碼保護,您的認證代理運行不正常:
 
$ ssh-add -l 
Could not open a connection to your authentication agent.

在過去的情況下,考慮「How to run (git/ssh) authentication agent?」或「ssh-add complains: Could not open a connection to your authentication agent

+0

不,這個錯誤是在其他地方:這是我的回購(所以我應該對它有完整的訪問權限),並使用正確的SSH URL(從GitHub網站複製)。 – automatix 2013-02-27 09:36:36

+0

@automatix是否使用了由密碼保護的預設密鑰? – VonC 2013-02-27 10:20:50

+0

我試過兩種 - 有和沒有密碼。結果是一樣的。 – automatix 2013-02-27 10:22:40

相關問題