我正在使用redhat6
,Jenkins ver. 1.609.3
,java1.6_45
和git 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.

这是我的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连接
使用id_rsa
创建d_rsa.pub
和ssh-keygen
密钥
默认位置。那是home/usrname/.ssh
副本
id_rsa.pub
中Bitbucket
键的内容。
/var/lib/jenkins/.ssh
id_rsa.pub
中的Bitbucket
。这也是工作从这里Stack-overflow solution for the same error尝试了所有解决方案,但dint工作。 我错过了什么?任何想法。
答案 0 :(得分:1)
尝试更改: