Git: Permission denied (publickey) fatal - Could not read from remote repository. while cloning Git repository

For people that come here that are just trying to get the repository but don't care about the protocol (ssh / https), you might just want to use https instead of ssh (if it's supported).

So for example you use

git clone https://github.com/%REPOSITORYFOLDER%/%REPOSITORYNAME%.git

instead of

git clone [email protected]:%REPOSITORYFOLDER%/%REPOSITORYNAME%.git

If there is still issue around access after creating SSH and adding it in your Bitbucket account or wherever, you need to do the following in terminal on GitBash, OSX or Linux:

# Lists already added identities (‘ssh keys’)
ssh-add -l

Then, if you don't see your key listed, add it with the following (replace identity with its real name):

# Add a new identity
ssh-add ~/.ssh/identity

This worked for me.


It looks like a permissions issue - not a Windows 7 issue.

Your ssh key is not authorised - Permission denied (publickey).

You need to create a public ssh key and ask the administrator of the Git repository to add the ssh public key

Information on how to do this: Saving ssh key fails

Tags:

Git

Git Clone