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

Someone has already added that key as an access key to a repository

Ivan Kol August 21, 2022

Hi,

I don't know what repository uses my key

Could you tell me, so I can remove it?

Thanks

1 answer

1 accepted

0 votes
Answer accepted
Nic Brough -Adaptavist-
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.
August 21, 2022

Welcome to the Atlassian Community!

 

There's no easy way to work this out because the keys that belong to other accounts should not be shared.

If you shared the key with someone, you should know who.  If you were given the key by someone, then you'll need to ask them.  

If you have no luck chasing it down, you can raise a support request with Atlassian, and they can search out the key for you and hence identify the account you shared it with.

If you don't want to spend ages chasing down the share, then you can (and should) create a new key for your account and use that instead.

Ivan Kol August 21, 2022

Hi,

the key is not shared and used only by me. I'm trying to use it globally for all my repositories and this message pops up.

I think it's been set to mine repo, because I followed your guide to setup ssh git access and it worked. Now I want to delete it and use it in my profile but I can't find it anywhere though.

Creating another pair should be my last resort.

Ivan Kol August 21, 2022

BTW: what exactly is the problem if the key is used in more than one repo?

Rob van der Lee August 22, 2022

I suppose it helps you work more structured. Bitbucket only allows a key to be added once. Once added, you won't be able to add it to another account/repository. This is a common good practice. I'm not sure what you are trying to do but let me try.

A way to gain access is to add the user holding that particular key to the desired group/repository.

Another way is to generate a new key for the account/repository. You have not provided any

 

Let me ask some questions to get some more information on what you are trying to do:

  1. Is the repository you are trying to access held under your account?
  2. Are there multiple accounts?

--

To add SSH keys on account level visit:
https://bitbucket.org/account/settings/ssh-keys/

Ivan Kol August 22, 2022

Some additional info:

 

  • Is the repository you are trying to access held under your account?

Yes, it is

  • Are there multiple accounts?

No

To add SSH keys on account level visit:
https://bitbucket.org/account/settings/ssh-keys/ - trying to add my key there gives me an error "Someone has already added that key as an access key to a repository" which surprises me...

Looking at Audit log, I think the key was added once at 2022-03-10

using this guide: https://support.atlassian.com/bitbucket-cloud/docs/set-up-an-ssh-key/

And command 

$ ssh -T git@bitbucket.org 

works.

What should I do next to set it on account level?

Rob van der Lee August 22, 2022

You should scan all your repositories. As you can add keys to a particular project. It might be on repository level. If it is not on this account than you should really think hard if it might have been added on another account.

I've had this once where I used one of my own keys on my work account and tried to add that key when I was at home.

If you cannot seem to find it then you still have the option to generate a keypair.

Ivan Kol August 22, 2022

Hmm,

I've found it at last... I don't understand why Bitbucket has so many places to put a key - there should be a central management for all repositories where the admin can see them all.

It's tedious work to walk through all repos for a single key...

Like Yirong Li likes this
Rob van der Lee August 22, 2022

I'm glad you found it! It can be confusing at first. It allows for some more flexibility. Let's say you want to setup some additional tooling that requires SSH. The repo level keys allow for purpose build keys.

Anyway, now you know. Happy coding! :)

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
TAGS
AUG Leaders

Atlassian Community Events