Search code examples
gitbitbucketssh-keysgit-clone

Error message "Someone has already registered this as a deploy key" on BitBucket


I'm trying to clone a git repo on my bitbucket account, but am getting this error message when trying to do the clone this repo. to a new PC I've set up:

Cloning into 'xxxxx'... 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.

And when I try to add the ssh key for this new machine to bitbucket, I get this error:

Someone has already registered this as a deploy key.

So it looks like I may have accidentally registered the ssh key for this machine as a deployment key at some stage. How do you locate which repo in bitbucket actually has this key registered as a deployment (as opposed to regular ssh access) key?

Sorry if this is not posted in the ideal place, I'll move it over to another SO section if there's one more relevant.


Solution

  • You can see where that key has been added with an SSH command: ssh -Ti /path/to/key git@bitbucket.org. It should come back with something like this:

    authenticated via a deploy key.
    
    
    You can use git or hg to connect to Bitbucket. Shell access is disabled.
    
    This deploy key has read access to the following repositories:
    
    owner/repo: Test key - owner@host.tld