【Git】git报错:[email protected]: Permission denied (publickey). fatal Could not read from remote repository

【Git】git报错:[email protected]: Permission denied (publickey). fatal

错误

使用git clone的时候报错[email protected]: Permission denied (publickey). fatal Could not read from remote repository.
如下图所示:
在这里插入图片描述

解决办法

添加SSH公钥

绑定gitee用户名和邮箱

git config --global user.name "你的gitee的用户名"
git config --global user.email "你的gitee注册或绑定的邮箱地址"

生成SSH公钥

ssh-keygen -t rsa -C "你注册的或绑定的邮箱地址"

这时会要你输入文件位置和密码,直接回车回车就行
在这里插入图片描述

找到你生成的公钥id_rsa_pub全部复制

输入密钥名称,把复制的密钥复制进去,点击确定即可完成。
在这里插入图片描述

测试是否成功

ssh -T [email protected]

输入上述命令,显示以下内容即成功。
在这里插入图片描述
接着就可以进行git clone操作了
在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/WwLK123/article/details/131731569
今日推荐