2015-09-22 51 views
0

我正在使用redhat6,Jenkins ver. 1.609.3,java1.6_45git 2.0.5。 雖然克隆與Jenkins的Bitbucket存儲庫,但我得到了波紋管錯誤。無法將Jenkins與Bitbucket連接

\t 
 
Failed to connect to repository : Command "/usr/local/git/bin/git -c core.askpass=true ls-remote -h [email protected]:DrunkenCooder/spring3helloworld.git HEAD" returned status code 128: 
 
stdout: 
 
stderr: Permission denied (publickey). 
 
fatal: Could not read from remote repository. 
 

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

error screen short

這是我的git可執行文件的路徑

/usr/local/git/bin/git 

當我去那裏的CD /在/ usr /本地/ git的/ bin中 並執行命令

git ls-remote -h [email protected]:DrunkenCooder/spring3helloworld.git 

是越來越成功執行。而我得到的波紋管輸出

b148eb99dead9a288afb0c9e6f6e87ae7aa133fe refs/heads/master 

步驟我也跟着詹金斯與到位桶

  1. 連接創建id_rsa和我d_rsa.pub重點用ssh-keygen

    這是有默認位置。那就是home/usrname/.ssh拷貝 id_rsa.pub的內容關鍵在Bitbucket

  2. 複製在/var/lib/jenkins/.ssh
  3. 同時更改文件的權限都id_rsa和id_rsa.pub文件
  4. 起初我已經生成的密鑰是超級用戶。我刪除了那些 文件,並再次使用用戶生成密鑰。將 id_rsa.pub的內容複製到Bitbucket中。這也力挺

嘗試從這裏的所有解決方案Stack-overflow solution for the same error但力度的工作。 我錯過了什麼?任何想法。

+0

由於詹金斯用戶,你能從'ssh -Tv git @ bitbucket.org'獲得用戶名嗎? –

回答