Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Permission denied (publickey)

span12 September 19, 2017

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
Atlassian Team members are employees working across the company in a wide variety of roles.
September 19, 2017

Siva,

Is your public key loaded?

ssh-add -l

 

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

span12 September 20, 2017

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
Atlassian Team members are employees working across the company in a wide variety of roles.
September 20, 2017

Siva,

Try and add your SSH key and then try again:

ssh-add -K ~/.ssh/span12-Bitbucket
span12 September 20, 2017

Thanks a ton Jesse.

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

 

Regards,
Siva

jyo
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
September 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
span12 September 21, 2017

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
Atlassian Team members are employees working across the company in a wide variety of roles.
September 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
AUG Leaders

Atlassian Community Events