Bitbucket 'repository access denied'

aondraGR February 21, 2018

Whenever I reboot my machine, I have to create a new SSH key because the previous one doesn't work. I validate that the public key file lines up with the one in my BitBucket settings, I've run `ssh git@bitbucket.org -Tv` and found that I was able to log in with no problem, but whenever I run any kind of command to the repository it gives me `repository access denied`. I have confirmed that my permissions are set up correctly.

As far as I know I am doing everything correctly on my part, but the only way to get it to work again is to set up a brand new SSH key  - which will then stop being accepted whenever my machine reboots.

1 answer

0 votes
Lonnie
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 13, 2018

Hey Alan, What's the client machine? Windows, Mac or Linux?  Are you using a client or is normal command line? The last question I have is if you are using Server or Cloud?

This should help me provide a better answer.

 

Thanks 

aondraGR April 12, 2018

Using Git Bash on a Windows machine. I am connecting to a BitBucket remote, so I guess cloud would be the answer to the last question?

Lonnie
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 17, 2018

Hey Alan, So I have seen issues like this before. So what you have to know is that there are different ENV's on your Windows machine. 

 

ENV's:

  • Local Windows Machine 
  • Putty Shell
  • Git Client

Check out the following KB:

https://confluence.atlassian.com/bitbucket/set-up-an-ssh-key-728138079.html

As you can see, Sourcetree, Git Bash, Putty and the OS all store the keys in different places. I would use the above KB to make sure you are creating the key correctly.

 

You can use config files to point to the private key from all of the above clients too. Here is a good resource for ssh config file:

https://www.digitalocean.com/community/tutorials/how-to-configure-custom-connection-options-for-your-ssh-client

Like pcrawcubes likes this
aondraGR April 17, 2018

Ah, so it seems the configuration was the culprit. I had an IdentityFile entry for bitbucket.org which was pointing to the standard format keyfile (stored at ~/.ssh/bitbucket_rsa) but PuTTy uses its own format (stored at ~/.ssh/bitbucket_rsa.ppk). I presume that when it tried to connect, it was expecting to use the wrong file. After I deleted that entry from the config file, I was able to connect again.

Thanks!

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events