GitHub出现问题:Please make sure you have the correct access rights and the repository exists。---解决

当遇到GitHub访问权限错误时,问题可能出在SSH公钥上。解决步骤包括删除known_hosts,生成新的ssh公钥,设置Git用户和邮箱,将公钥内容粘贴到GitHub SSH设置中,最后通过ssh -T验证连接。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

GitHub出现问题:Please make sure you have the correct access rights and the repository exists。

原因:公钥出问题了,要先设置用户和邮箱再重新生成ssh公钥即可。

1.  删除.ssh文件夹(直接搜索该文件夹)下的known_hosts

2.打开Git Bash输入:ssh-keygen -t rsa -C "username" (注:username为你git上的用户名),

如果执行成功。返回的是:

Generating public/private rsa key pair.

Enter file in which to save the key (/Users/username/.ssh/id_rsa): //这里的username是电脑上的用户名,这个地址也是文件的存储地址

3.直接按回车

如果你以前有存储地址会返回/Users/your username/.ssh/id_rsa already exists.Overwrite (y/n)?    

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值