It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Bitbucket 'repository access denied'

Alan Ondra Feb 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 Roscillo Atlassian Team Mar 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 

Alan Ondra Apr 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 Roscillo Atlassian Team Apr 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 Prashant Chaudhari likes this
Alan Ondra Apr 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
This widget could not be displayed.
This widget could not be displayed.
Community showcase
Published in Bitbucket Pipelines

Building a Bitbucket Pipe as a casual coder

...ipe.sh :  #!/bin/bash source "$(dirname "$0")/common.sh" enable_debug extra_args="" if [[ "${DEBUG}" == "true" ]]; then extra_args="--verbose" fi # mandatory variables R...

1,909 views 1 19
Read article

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you