[email protected]: Permission denied (publickey)

[email protected]: Permission denied (publickey).

问题详情:
[email protected]: Permission denied (publickey). fatal: Could not read from remote repository.

1. 设置Git的user name和email
git config --global user.name "yourname"
git config --global user.email "youremail"
2. 生成SSH密钥

查看是否已经有了ssh密钥:cd ~/.ssh
有则备份删除:
image

生成密钥:

ssh-keygen -t rsa -C "youremail"

按3个回车,密码为空。
git@github.com: Permission denied (publickey)_第1张图片

3.生成的密钥文件:
id_rsa和id_rsa.pub  
4.添加密钥到ssh:
ssh-add ~/.ssh/id_rsa

image

5.获取公钥:

image

6.github配置公钥:

git@github.com: Permission denied (publickey)_第2张图片

7.测试是否畅通:

ssh -T [email protected]

image

你可能感兴趣的:(日常问题处理)