Having a EC2 instance with a Git repository, I need to update it by ssh-key
.
I tried:
Add authorized_keys
into GitHub. --> Not working and not the right way.
Create a new ssh-key, add it into EC2 console pair-key and add into GitHub. As ssh-add not working at EC2 instance, @Biswajit Mohanty suggested me to run ssh -T git@github.com, and got the proper answer but still getting 'permission denied (publickey). fatal: could not read from remote repository' when pulling.
I already configured the .git/config as it should:
sshCommand = "ssh -i ~/.ssh/id_rsa.pub"
[remote "origin"] url = ssh://git@github.com/ArantecEnginheria/smartyplanet.git
Any suggestion about to success doing a 'pull' and update the code into that server?
You generally do not add an authorized_keys
to GitHub. You register a public SSH key to your GitHub user profile, in order to establish the proper authentication.
If you need to push to a GitHub repository from an EC2 instance, (meaning from an EC2 instance session), then said session should include a ~/.ssh/id_rsa
and ~/.ssh/id_rsa.pub
: private/public key pair, with the public one registered to GitHub as mentioned above.