r/git • u/Spiritual-Potato8091 • Oct 16 '26
SSH Keys for github denied
I´ve had a SSH key for my account for several months, in my notebook. I have never had a problem with it.
Yesterday, I created a second SSH key for my desktop PC the same way, just adding a passphrase for it.
I had to sign in on the PC with my github account and all to reset my account password because I forgot it
But today I wanted to fetch/pull a repo from the notebook. and It kept sending me the following error
git@github.com: Permission denied (publickey).
fatal: Could not read from remote repository.
I deleted the new SSH key, but it still doesnt work. However, the authentication command works
(ssh -T git@github.com)
The permission denial appears for both extern repositories and for my own ones too.
What am I missing?
View all comments
2
u/Broad-Promise6954 ancient Oct 16 '26
If you're on Windows, you have two different ssh implementations available. Your command line and your git command are using different ones that have different configurations.
I still avoid Windows and don't recall offhand where to fix this, but poke around with tracing (eg GIT_TRACE).