Fix duplicate SSH key and access key issue?

How can I find where I've accidentally used my personal SSH key as an access key on a project?

It looks like something has changed in BitBucket where I now can't do anything with my account with SSH. I am getting this error from the command line:

"$ git pull
Warning: Permanently added 'bitbucket.org,104.192.143.1' (RSA) to the list of known hosts.
repository access denied. deployment key is not associated with the requested repository.
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists."

Last time I tried anything and it all worked was last Tuesday.

 

Problem is that I've got 200 repos and I'm not sure I want to go through and check the access keys for each one in case I've duplicated my personal SSH key there. Is there any way to fix this more easily...if this is indeed the problem?

 

1 answer

1 accepted

0 vote

`ssh -Ti /path/to/key git@bitbucket.org` should tell you which account or repos, if any, are associated with a particular key.

Hi James,

Thanks for your quick reply. I gave that a go and do indeed get a response with a repo and access key label in it. However, it does not match my key.

Anything else you can suggest?

It's ok, fixed. Thank you!

In my case this returns a user 'xyz' that I may have used in the past, but cannot reach anymore. So I cannot remove the ssh key from that user. What to do?

Suggest an answer

Log in or Join to answer
Community showcase
Piotr Plewa
Published Dec 27, 2017 in Bitbucket

Recipe: Deploying AWS Lambda functions with Bitbucket Pipelines

Bitbucket Pipelines helps me manage and automate a number of serverless deployments to AWS Lambda and this is how I do it. I'm building Node.js Lambda functions using node-lambda&nbsp...

714 views 0 4
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot