Thursday, January 16, 2025

git@github.com: Permission denied (publickey)

 Error when cloning git after adding SSH key. Below is the error

git@github.com: Permission denied (publickey).

fatal: Could not read from remote repository.


Fix :


First make sure you have added SSH key correctly. On right hand side of top corner under profile, you can see settings. In setting click on SSH and GPG keys and add your key as authentication keys.


Then login to the server or desktop from where you generated the key or have its private key, 

eval `ssh-agent -s`

ssh-add ~/.ssh/id_rsa


Wait for some time and try git clone, it will work.

No comments:

Post a Comment