I've never cloned a private GitHub repository. So I followed GitHub's guide but it's still rejecting me. I have a Red Hat linux server on AWS. I did the following:
ssh-keygen -t rsa -b 4096 -C "< my github email address >"
.eval "$(ssh-agent -s)"
.ssh-add ~/.ssh/id_rsa
.cat ~/.ssh/id_rsa.pub
(to get the value of the key).Ran ssh -T [email protected]
and it outputted this:
Hi AskYous! You've successfully authenticated, but GitHub does not provide shell access.
Ran sudo git clone [email protected]:AskYous/google-code-challange.git
(a private repository I own). This is when I got the following error:
Cloning into 'google-code-challange'... Permission denied (publickey). fatal: Could not read from remote repository.
Please make sure you have the correct access rights and the repository exists.
The problem was, and I don't know how this happened, is that the private key changed so this new key was not stored on GitHub. It changed somehow. Perhaps I ran the generation process twice.
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments