2017-03-08 106 views
0

我想從我的Team Foundation Server域上的項目中克隆一個repo。我在我的個人資料安全下創建了一個SSH密鑰。接受回購的鍵後,但是我仍然要求使用密碼進行登錄和認證失敗:微軟TFS ssh克隆失敗

git clone ssh://[email protected]:22/Project/_git/project-repo 
Cloning into 'project-repo'... 
[email protected]'s password: 
Permission denied, please try again. 
[email protected]'s password: 
Permission denied, please try again. 
[email protected]'s password: 
Permission denied (password,publickey). 
fatal: Could not read from remote repository. 

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

我已經試過我的兩個visualstudio.com密碼,其中work.But爲什麼SHH密鑰口令無問我一個密碼?

+0

什麼版本的TFS? –

回答

0

前提,以使用ssh爲VSTS如下:

  1. 生成SSH密鑰。在git bash中,在git bash中使用ssh-kengen - >選擇保存密鑰的路徑 - >輸入密碼(如果不需要密碼,請直接按enter鍵)。
  2. 在VSTS SSH公鑰(profile - > security)中的KeyData中添加.ssh/id_rsa.pub文件的內容。

對於你的情況,似乎.ssh/id_rsa.pub的內容與VSTS SSH公鑰不一樣。所以你最好先用上面的step1和setp2再用ssh協議再次克隆10個。

0

我解決這個問題的方法是通過刪除並重新創建我的id_rsa.pub而無需輸入密碼。