Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Ssh keys addition to bitbucket server repo

ryan gnatt September 2, 2019

Hi All,

bitbucket is very good program for learning programming. I was trying to automate bitbucket ssh keys addition in our bitbucket repo setup. As i am aware of that we add the ssh keys through bitbucket web url after copying from end points but i would like to know where those ssh keys are saved (in db or file )which we save through web url so that i dont have to manually add for each endpoint rather i can automate the solution .

Thanks

1 answer

1 vote
Rafael Pinto Sperafico
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 2, 2019

Hi @ryan gnatt ,

It seems you are referring to Bitbucket Server. If so, you could call Bitbucket's REST API to add the SSH key - https://docs.atlassian.com/bitbucket-server/rest/6.6.0/bitbucket-ssh-rest.html

In case you want to get a list of Projects, Repositories you can refer to https://docs.atlassian.com/bitbucket-server/rest/6.6.0/bitbucket-rest.html . With that, you could simply iterate over all the repositories you need and place the SSH key using the previous URL.

If Bitbucket Cloud is what you are looking after, the have a look at https://developer.atlassian.com/bitbucket/api/2/reference/resource/users/%7Busername%7D/ssh-keys

Kind regards,
Rafael

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events