Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

I am trying to configure bitbucket with jenkins using git plugin via ssh

ChakradharReddy
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
February 19, 2024

I copied the private key from the Jenkins machine running on Docker and ensured it is in the Jenkins user. I then pasted the private key into global credentials as an SSH user with a private key. Additionally, I copied the public key to the repository settings in Bitbucket under 'Access Keys'. However, when I tried to check the connection while configuring the pipeline, it threw an error stating 'STDERR: fatal: repository doesn't exist or you don't have access rights'. I checked various forums, but most solutions contain errors, while my issue is displaying code 128 and above

1 answer

1 vote
Patrik S
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 20, 2024

Hello @ChakradharReddy and welcome to the Community!

The error output indicates an authentication issue between Jenkins and Bitbucket, so I suspect there's potentially some setting missing on Jenkins's side. I found the following article containing step-by-step instructions on how to configure the SSH connection on Jenkins that may be of help : 

If after following the steps in that article you are still not able to authenticate, I would suggest running the following command to test your connection to Bitbucket Cloud using the same SSH key you configured in Jenkins : 

ssh -Tvvv -i <path to the private key file - the same key you used on Jenkins> git@bitbucket.org

This will provide further details on the SSH authentication and if the key is being recognized by bitbucket.

Thank you, @ChakradharReddy !

Patrik S

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events