I'm trying to clone a private Github repo to a new Amazon EC2 (Ubuntu) instance.
The EC2 Instance fails to git clone <PATH> due to
git@github.com: Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
Here's my steps:
- Run
ssh-keygenon local machine - Add the newly generated public key (
~/.ssh/id_rsa.pub) into GitHub 'SSH Keys' section - Also import that public key into the EC2 'Key Pairs' dashboard
- Make the instance ensuring that new Key Pair is used during launch
- log into EC2 instance, update
yumandyum install gitetc - Try
git clone <PATH>but get permission error. Works fine on local machine...
I'm not fully understanding how EC2 is using my Key Pair... why doesn't GitHub recognize the EC2 instance?