Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

One ssh-key to all repositories in bitbucket

We have a application account in my server for which we have generated a ssh-key. We need to upload the application account public key to all the repositories in my bit-bucket project. There are so many repositories in my project we can't upload the keys manually in every repository every time we generate a new key. So Do we have any automated way to do this?

like image 674
suru1432002 Avatar asked Dec 29 '16 07:12

suru1432002


2 Answers

If I understood your question properly. I will explain a few things about BitBucket SSH Access, After that hopefully, you will get your answer.

If you go to your main BitBucket setting, You will see SSH Keys option under the Security. Here you will able to add your SSH Public Key. In my cases I already have a RAS SSH Public key called id_ras.pub After adding this key I can access all of my BitBucket repositories using SSH from my PC whatever it's new or old repo. You are also able to add multiple SSH Key to your BitBucket account.

Screenshot: BitBucket Account SSH Keys Settings

They have another option to get read-only access called Use access keys.

In this section, You are able to add SSH Public key per-repository basis. After adding User Access Keys the key owner can access this specific repo using SSH. But They will have Read Only access only. You can use your same User Access Keys in multiple repositories. So, they will have multiple repo access using the key.

Be sure the key can't be the same key as your Main BitBucket Settings Keys You need to use another public key as your User Access Keys

Screenshot: BitBucket User Access Keys Settings

In my cases, I don't have any user access keys. You can know more about Main Account SSH Keys & User Access Key using their help link.

like image 76
JEWEL AHMMED Avatar answered Oct 14 '22 08:10

JEWEL AHMMED


I think op is asking about where to add a ssh-key that allows access to all repositories (for automated clones in pipeline etc). To best of my knowledge you do this within your workspace

https://bitbucket.org/YOURWORKSPACE/settings/ssh-keys. if you have already added that key to any of your repos under access keys it will fail though so best to make a new key, or go through all your projects and remove it then add it here

like image 41
H23 Avatar answered Oct 14 '22 08:10

H23