git clone出现Permission denied (publickey)解决办法
程序员文章站
2022-07-13 16:11:35
...
问题
在执行代码clone时
git clone aaa@qq.com:xxx/xxx.git
出现问题
Permission denied (publickey)
原因
无权限, 未将公钥添加至GitHub
解决思路
- 本地生成**
- 登录GitHub配置SSH Key
具体步骤
步骤一
生成私钥-公钥对
windows
ssh-******.exe -t rsa -C "aaa@qq.com"
linux,mac
ssh-****** -t rsa -C "aaa@qq.com"
步骤二
三次回车, 即生成私钥和公钥, 生成目录为:
windows
/C/Users/admin/.ssh
linux,mac
~/.ssh
步骤三
打开文件,复制公钥
cat ~/.ssh/id_rsa.pub
步骤四
登录GitHub,将上一步公钥粘贴至文本框, 保存。具体为
在页面右上角自己头像右边箭头处右击,弹框中进入setting功能;
setting界面右边菜单选择SSH and GPG keys,选择新建SSH keys,粘贴上id_rsa.pub拿到的公钥
现在重新去执行git clone去下载代码则能成功
参考
推荐阅读
-
出现Git clone The requested URL returned error: 403 错误的解决办法
-
git@github.com: Permission denied (publickey). fatal: Could not read from remote repository.
-
git clone报错:Permission denied (publickey). fatal: Could not read from remote repository...
-
git clone出现Permission denied (publickey)解决办法
-
Git报错解决:[email protected]: Permission denied (publickey).
-
git报错:[email protected]: Permission denied (publickey)
-
Linux下出现permission denied的解决办法
-
出现Git clone The requested URL returned error: 403 错误的解决办法
-
IDEA中使用git报错Permission denied (publickey)
-
linux git clone 仓库报错: Permission denied (publickey)