However, this is not enough as you have to also add your public key id_rsa.pub to your github account by going to your account's settings, clicking on "SSH and GPG keys," and then clicking "New SSH key."
Then just to be safe I would run the following two commands:
eval "$(ssh-agent -s)" ssh-add ~/.ssh/id_rsa
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Thanks for your post. I have created two workflows one for staging one for prod. When I run $ git fetch
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.
stackoverflow.com/questions/133635...
@precampio as @hammykl20 pointed out you need to add github to the ssh known_hosts list like the following:
ssh-keyscan -t rsa github.com >> ~/.ssh/known_hostsHowever, this is not enough as you have to also add your public key
id_rsa.pubto your github account by going to your account's settings, clicking on "SSH and GPG keys," and then clicking "New SSH key."Then just to be safe I would run the following two commands:
eval "$(ssh-agent -s)"ssh-add ~/.ssh/id_rsa