无法将Jenkins与Bitbucket连接起来

时间:2015-09-22 12:55:32

标签: git jenkins ssh

我正在使用redhat6Jenkins ver. 1.609.3java1.6_45git 2.0.5。 在用Jenkins克隆Bitbucket存储库时,我得到了更大的错误。



	
Failed to connect to repository : Command "/usr/local/git/bin/git -c core.askpass=true ls-remote -h git@bitbucket.org: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 / local / git / bin 并执行命令

 git ls-remote -h git@bitbucket.org:DrunkenCooder/spring3helloworld.git

它正在成功执行。我得到波纹管输出

b148eb99dead9a288afb0c9e6f6e87ae7aa133fe    refs/heads/master

我遵循的步骤将Jenkins与Bitbucket连接

  1. 使用id_rsa创建d_rsa.pubssh-keygen密钥

    默认位置。那是home/usrname/.ssh副本 id_rsa.pubBitbucket键的内容。

  2. /var/lib/jenkins/.ssh
  3. 中复制了id_rsa和id_rsa.pub文件
  4. 将两个文件的权限更改为
  5. 起初我生成的密钥是超级用户。我删除了那些 文件并使用用户再次生成密钥。复制了内容 id_rsa.pub中的Bitbucket。这也是工作
  6. 从这里Stack-overflow solution for the same error尝试了所有解决方案,但dint工作。 我错过了什么?任何想法。

1 个答案:

答案 0 :(得分:1)

尝试更改:

  1. 存储库地址到 的 https://bitbucket.org/DrunkenCooder/spring3helloworld.git
  2. / usr / local / git / bin / git 简单 git