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

Can't use ssh key twice at two different Bitbucket Workspaces

Andree Holz
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!
August 4, 2021

Hi,

I have two Bitbucket workspaces who are connected with my Bitbucket Account.

I have added at one workspace to one repository a  ssh key as an "Access Key".
It's the key from a jenkins server user.

Now i need in another workspace also for the jenkins user access for the jenkins user.
But I can't add the because of the error "Someone has already added that SSH key to another account." but the jenkins user can't get access to this repro
how can i solve the problem with these two workspaces?

2 answers

2 votes
Caroline R
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 6, 2021

Hi, @Andree Holz! Welcome to the community! 

You can't use the same key between accounts. You must create new keys for each individual Bitbucket account.

In this case, I would suggest you add this SSH key on this Jenkins user (not as an access key to the repository) and give them read access to the repositories you need. This way, you can use this SSH key on multiple workspaces/repositories.

In case you would like to read more about SSH keys, you can access the following link:

I hope this helps, but please let me know if you face any obstacles. 

Kind regards,
Caroline

0 votes
joykevin
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!
August 9, 2024

I've had the same "problem" as I wanted to use the same SSH-Key on multiple repositories / workspaces.

 

Thanks to the answer of @Caroline R I managed to find a way that actually solves this.

 

For anyone else having this issue and needing a solution, there's at least three ways to add SSH-Keys to Bitbucket.

  • To the repository
    • (When you only need access to a single repository)
  • To the workspace
    • (Which was how I did it before when needing to access multiple repositories)
    • Gives access to all repositories within this workspace.
  • To the user
    • (Which is what I'm going to do now)
    • If the user has access to both workspaces, the added SSH-Key will have access to all the repositories within those workspaces by adding the SSH-Key in question only once on user level.

Since every SSH-Key can only be added once, this should at least serve as a workaround for some cases.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events