GitHub: Permission denied (publickey). fatal: Could not read from remote repository
- Generate SSH key using
ssh-keygen -t rsa -b 4096 -C "your email"
. - Copy the output of
cat ~/.ssh/id_rsa.pub
to your clipboard - Paste the above copied output to the form at https://github.com/settings/ssh/new
- On your GitHub profile there is an
Edit Profile
button.
It is located on top-right corner of the webpage. - Press it and you will see left
Personal Settings
menu. - Inside that menu find
SSH and GPG keys
option and press it. - You will see an option
New SSH key
to add new key.
generate your key
ssh-keygen
Visualize your keys
ls ~/.ssh
id_rsa id_rsa.pub
Start the agent
eval
ssh-agent
Add your key to the agent
ssh-add ~/.ssh/id_rsa