2015-06-17 174 views
0

我想設置我的生成服務器(Windows 2008機器)來構建從GitHub企業我的項目,但我正在逐漸Permission Denined (Public Key)當我嘗試克隆一個回購協議。我已經生成了ssh密鑰並將其添加到github配置文件中。無法克隆的git回購

這是我嘗試測試ssh連接並克隆回購時的情況。

D:>ssh -T [email protected] 
Hi my_user! You've successfully authenticated, but GitHub does not provide shell access. 

D:\>git clone [email protected]:myOrg/leaf.git 
Cloning into 'leaf'... 
Permission denied (publickey). 
fatal: Could not read from remote repository. 

Please make sure you have the correct access rights 
and the repository exists. 

我試過這兩個git bash和Windows命令提示符。

請讓我知道是否有任何我想念或如果您需要任何更多的信息。

+0

您可能需要指定IdentityFile在〜/ .ssh/config中。 – jangler

+0

專注於一個環境,windows命令提示符與git bash環境不一樣。你說你把你的密鑰添加到github配置文件中,但是你表明你正在使用github企業版。你確定這兩項服務一起溝通,知道你已經提供了你的ssh密鑰給一個,但不是另一個?您需要提供您的公鑰到git.company.com聲明它需要的地方。我冒昧地說,你需要問你的服務提供商(在company.com上)而不是SO來尋求幫助。 – vgoff

回答

0

Github上拒絕你的訪問,這意味着無論是SSH密鑰不設置或公鑰不與GitHub上的私鑰關聯。

  1. 嘗試生成ssh密鑰並添加到github中的.ssh/as id_rsa.pub。

  2. 使用HTTPS,而不是使用ssh

+0

OP表示github企業正在使用,他在提交公鑰時嘗試驗證git.company.com。我懷疑是github拒絕了這個請求,因爲他正在請求另一臺服務器。 – vgoff

+1

如果你看看帖子github不否認訪問。當我使用'ssh -T'嘗試時,它確實成功通過了身份驗證。我試圖重新生成密鑰並添加密鑰沒有幫助。我也驗證了本地和github上的ssh指紋,並且它們匹配。 – Amrish

-1

試穿混帳擊: $ 混帳配置--global -l

如果響應是一些爲:http.proxy = http://:0。然後,你必須取消設置HTTP代理服務器:

$ 混帳配置--global --unset http.proxy

現在嘗試克隆,它應該通過