您现在的位置是:首页 >技术教程 >解决git@github.com:Permission denied (publickey). Could not read from remote repository. Please make s网站首页技术教程
解决git@github.com:Permission denied (publickey). Could not read from remote repository. Please make s
简介解决git@github.com:Permission denied (publickey). Could not read from remote repository. Please make s
在进行项目clone的时候出现报错
git@github.com:Permission denied
(publickey).
Could not read from remote repository.
Please make sure you have the correct
access rights
and the repository exists.
这个错误通常表示没有正确的权限来访问该 Git 仓库。
为了解决GitHub上的权限问题,需要执行以下步骤:
1、生成SSH密钥对
打开命令行终端(例如Git Bash)并输入以下命令:
ssh-keygen -t rsa -b 4096 -C "你的电子邮件地址"
2、添加SSH密钥到GitHub帐户
将公钥添加到GitHub帐户中, 执行以下步骤:

在“Title”字段中为新密钥提供一个描述性标题。

将“Key”字段中的公钥粘贴到GitHub帐户的“Key”字段中。 公钥文件通常在以下位置:C:UsersAdministrator.ssh

单击“Add SSH key”按钮。
3、测试SSH连接
在命令行终端中,输入以下命令以测试SSH连接是否正常工作:
ssh -T git@github.com
如果您的SSH密钥正确设置,您应该会收到以下消息:
Hi lfsun666! You've successfully authenticated, but GitHub does not provide shell access.
这表明已成功通过SSH进行身份验证,现在可以访问GitHub存储库并使用Git命令。
风语者!平时喜欢研究各种技术,目前在从事后端开发工作,热爱生活、热爱工作。





U8W/U8W-Mini使用与常见问题解决
QT多线程的5种用法,通过使用线程解决UI主界面的耗时操作代码,防止界面卡死。...
stm32使用HAL库配置串口中断收发数据(保姆级教程)
分享几个国内免费的ChatGPT镜像网址(亲测有效)
Allegro16.6差分等长设置及走线总结