solution to git@github.com出现Permission denied (publickey)
Create SSH key
1
2
3
4
5
6
7
8
9# change your path to .ssh file
cd ~/.ssh
# create new SSH key
ssh-keygen -t rsa -b 4096 -C "your git email"
# note that name of the file to save key should be "id_rsa"
# if you use other name, it will reprot "Permission denied (publickey)." when "ssh -T git@github.com"
# if you use other name, remember to add it
ssh-add ~/.ssh/your_nameAdd SSH key to git
You are supposed to find
id_rsa
andid_rsa.pub
. The former is you SSH key.Create a new SSH key in your github and copy everything in
id_rsa.pub
to it.Test your connection with git
ssh -T git@github.com
If there is no bug report, you key is acceptable.