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

Permission denied (publickey)

Permission denied (publickey).

fatal: Could not read from remote repository.

 

Please make sure you have the correct access rights

and the repository exists.

Permission denied (publickey).

fatal: Could not read from remote repository.

 

Please make sure you have the correct access rights

and the repository exists.

Permission denied (publickey).

fatal: Could not read from remote repository.

 

Please make sure you have the correct access rights

and the repository exists.

Permission denied (publickey).

fatal: Could not read from remote repository.

 

Please make sure you have the correct access rights

and the repository exists.

1 answer

0 votes
jyo Atlassian Team Sep 19, 2017

Siva,

Is your public key loaded?

ssh-add -l

 

If you're on Windows is Pageant.exe loaded with the correct key?

Hi Jesse,

In the current environment that I work, I use bitbucket and sourcetree. I usually create a feature branch in bitbucket and then checkout using source tree.

Few days back , I had to change my login password. From that day I was unable to checkout into sourcetree. I tried to delete my local branches, and some how now I am encountered with lot of issues. 

 

jyo Atlassian Team Sep 20, 2017

Siva,

Try and add your SSH key and then try again:

ssh-add -K ~/.ssh/span12-Bitbucket

Thanks a ton Jesse.

That is magic. Now I am able to checkout. :):)

 

Regards,
Siva

jyo Atlassian Team Sep 20, 2017

No problem! An easier way to do this would be to add an entry to your config file, which would make it so you wouldn't have to add your key upon startup:

1. Create a file named "config" under your ~/.ssh/ directory

2. Add this entry:

Host *
  UseKeychain yes
  AddKeysToAgent yes
  IdentityFile ~/.ssh/span12-Bitbucket

Hi Jesse,

 

I see "config" already in there. Here are the contents :

# --- SourceTree Generated ---
Host span12-Bitbucket
HostName bitbucket.org
User span12
PreferredAuthentications publickey
IdentityFile /Users/span12/.ssh/span12-Bitbucket
UseKeychain yes
AddKeysToAgent yes
# ----------------------------

But I don't see " Host * " should I need to add this ?

 

Regards,

Siva

jyo Atlassian Team Sep 21, 2017

"Host *" would set the key to be used with any hosts you connect to. If you're only using the key for Bitbucket Cloud, then your entry is fine.

Here's another example of setting up multiple hosts with the same key file: https://unix.stackexchange.com/questions/16571/multiple-host-in-ssh-config

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Sourcetree

Sourcetree for Windows - CVE-2019-11582 - Remote Code Execution vulnerability

A vulnerability has been published today in regards to Sourcetree for Windows.  The goal of this article is to give you a summary of information we have gathered from Atlassian Community as a st...

4,955 views 0 12
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