Permission denied (publickey). fatal: Could not read from remote repository.

Getting

Permission denied (publickey).
fatal: Could not read from remote repository.

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

When trying to git clone from bitbucket account to my server (works fine locally on my mac)

4 answers

1 accepted

3 votes
Colin Goudie Community Champion Oct 25, 2012

Your server's private ssh key is most probably different to your local private key

You need to also tell Bitbucket about your keys on your server.

Thats why i suspected, but now I have added the ssh key from the cpanel account (I have a WHM and 3 accounts)

http://screencast.com/t/YX6f1X9gZ

I added the rsa one, does that make a difference? http://screencast.com/t/QtYeaxN9i9q

But I am getting the same error http://screencast.com/t/iZ17U2mn44mh

Here is what I am trying to do

http://screencast.com/t/gWGewHZA6

I have the same problem. Even when I create key with kommand
ssh-keygen -t rsa -b 4096 -C "email@domain.com" and inspect that code, add them on my repository "Add key" still doesn't work.

Me too having the same problem.

I'm facing the same problem. I have followed the steps in the guide by Bitbucket which tells how to set up a new SSH key and add it globally to Bitbucket. I did it via the Sourcetree GUI, but I still keep getting the message that Sourcetree could not read from the remote repository. I don't understand how to fix this.

Screen Shot 2017-10-12 at 12.19.17.jpg

Make sure you have added your key to your bitbucket profile settings and not your repository settings. The guide on how to generate a new ssh key does not explicitly make a distinction between the two. If you have added your key to the settings within your repository, then you won't have the correct access rights.

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Meg Holbrook
Posted Monday in Off-topic

Miscellaneous Monday - Throwback Edition

It's Monday morning here is sunny California! (86 degrees in April, what is happening right now??) Time for another Miscellaneous Monday! I was having a random conversation with my nine-year-old thi...

2,562 views 36 2
Join discussion

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