如何解决[email protected]: Permission denied (publickey)异常

如何解决[email protected]: Permission denied异常

一、错误信息描述

[email protected]: Permission denied (publickey). fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists.

原因:

权限被拒绝(公钥)。致命错误:无法从远程存储库读取。请确保您具有正确的访问权限并且存储库存在。

二、解决办法

2.1、获取本地SSH Key

  • 先执行ssh-keygen -t rsa -C '[email protected]', 看本地是否存在ssh key
  • 若本地存在,直接执行cat ~/.ssh/id_rsa.pub 获取,执行命令后如下

2.2、将本地的SSH Key添加到github


相关推荐
thels_2 小时前
记录一个用了很久的git提交到github和gitee比较方便的方法
git·gitee·github
雨白5 小时前
初识版本控制工具 Git
git
三道杠卷胡5 小时前
【AI News | 20250609】每日AI进展
人工智能·python·语言模型·github·aigc
急速前行Klein6 小时前
Ubuntu中安装git
linux·git·ubuntu
红衣信8 小时前
电影项目开发中的编程要点与用户体验优化
前端·javascript·github
寻月隐君9 小时前
Rust + Protobuf:从零打造高效键值存储项目
后端·rust·github
qianmoQ9 小时前
GitHub 趋势日报 (2025年06月07日)
github
饼干ovo12 小时前
shell编程
java·git·github
HelloGitHub14 小时前
3 个超火的开源项目「GitHub 热点速览」
开源·github
JinSo15 小时前
create-easy-editor —— 快速搭建你的可视化编辑器
前端·前端框架·github