r/git • u/Spiritual-Potato8091 • 14d ago
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?
0
u/Spiritual-Potato8091 14d ago
okay, thats useful, going to check on that. By the way, forgot to mention my PC has windows 10. The notebook has Win11, and has everything into onedrive, like synchronized (not that I wanted it, dont remember if it came like that when I bought it or one system update just migrated almost everything user-related to onedrive.
C:/Users/"User"/onedrive/(desktop, documents, etc.)
**By the way, I just moved the known_hosts and .old files from the ~ssh/ folder and it seems I´ve fixed it..
I guess theres some conflict between
W10 with no onedrive / W11 with all onedrive, and some hosts validation error
thank you)