Issue
I had SSH key paired with my Win10 machine and Github account, and it's was working on Bash, but today I installed ZSH (oh-my-zsh) via WSL, and now when I'm trying to push I see the next error:
[email protected]: Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
In ZSH:
ssh -T -ai ~/.ssh/id_rsa [email protected]
[email protected]: Permission denied (publickey).
In Bash:
$ ssh -T -ai ~/.ssh/id_rsa [email protected]
Hi UserName! You've successfully authenticated, but GitHub does not provide shell access.
Solution
I installed ZSH on Ubuntu (WSL2) in order to follow your steps. In my case, I could push to the remote via ZSH shell. The problem seems to be in your SSH key inside WSL. Follow the step to generate another key to pair inside your WSL.
This is so because your first SSH key from Windows is located in one place and the SSH key that you need now need to be placed inside WSL.
Answered By - Paulo Felipe Souza Answer Checked By - Gilberto Lyons (WPSolving Admin)