I decided to try using SSH to work with my GitHub repos. I modified remote url in git/.config, so now it uses SSH:
[remote "origin"]
url = [email protected]:keddad/passpoint_server.git
fetch = +refs/heads/*:refs/remotes/origin/*
But when I ran git fetch, for example, git is looking for a wrong key:
(venv) keddad@keddad-pc:~/PycharmProjects/passpoint_server/.git$ git fetch
no such identity: /home/keddad/.ssh/github_rsa: No such file or directory
[email protected]: Permission denied (publickey).
fatal: Could not read from remote repository.
In the same time, the real key which is added to GitHub is in a file ~/.ssh/id_rsa How do I make git use the id_rsa key?
try this:
ssh-add ~/.ssh/correct_key
Looks like my ~/.ssh/config was poorly configured:
Host github.com
IdentityFile ~/.ssh/github_rsa
IdentitiesOnly yes
I needed to change the IdentityFile to a real file, in my case, id_rsa
Host github.com
IdentityFile ~/.ssh/id_rsa
IdentitiesOnly yes
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With