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

git@github.com: Permission denied (publickey)

1. 进入git bash , 输入git config --global --list 如果有显示用户名和邮箱,检查是否一致,如果不一致或不显示,进入下一步

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

2.依次输入下面的两条指令配置GitHub用户名和邮箱(需与GitHub注册时一致)

git config --global user.name "yourName"
git config --global user.email "yourEmail"

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

3.输入ssh-keygen -t rsa -C "yourEmail" 然后一直按回车,直到出现选择时输入Y,再一路回车直到生成密钥 密钥保存路径为/Users/YourUserName/.ssh/id_rsa.pub

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

4. 到GitHub添加密钥

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

5. 链接测试

返回 git bash ,输入 ssh -T git@github.com 返回如下图所示则说明连通了
git@github.com: Permission denied (publickey).

否则尝试输入:

ssh-agent -s
ssh-add ~/.ssh/id_rsa
上一篇:wireguard使用方法


下一篇:理解 KingbaseES 中的递归查询