Reputation: 4452
I am using redhat6
, Jenkins ver. 1.609.3
,java1.6_45
and git 2.0.5
.
While cloning the Bitbucket repository with Jenkins I am getting bellow error.
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.
This is the path for my git executable
/usr/local/git/bin/git
When I go there cd / /usr/local/git/bin and execute the command
git ls-remote -h [email protected]:DrunkenCooder/spring3helloworld.git
It is getting executed successfully. and I get the bellow output
b148eb99dead9a288afb0c9e6f6e87ae7aa133fe refs/heads/master
Steps I followed to connect Jenkins with Bitbucket
created id_rsa
and id_rsa.pub
key using ssh-keygen
which is there in default location. that is home/usrname/.ssh
copy
the content of id_rsa.pub
key in Bitbucket
.
/var/lib/jenkins/.ssh
id_rsa.pub
in Bitbucket
. This also dint worktried all the solution from here Stack-overflow solution for the same error but dint work. What am I missing? any idea.
Upvotes: 0
Views: 671
Reputation: 419
Try change:
Upvotes: 1