栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 系统运维 > 运维 > Linux

github - git@github.com: Permission denied (publickey). Could not read from remote repository.

Linux 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

github - git@github.com: Permission denied (publickey). Could not read from remote repository.

解决 git@github.com: Permission denied (publickey). Could not read from remote repository
  • 前言
  • 一、解决思路
    • 生成客户端的key
      • 验证客户端和远程github的连接情况


前言

问题:正如标题所述,新建一个项目的时候,将项目发布到github上,但是出现所述的问题
出现这个问题是在gith pull 之后

一般的步骤是:

git add .
git commit -m "first commit"
git remote add origin https://github.com/xxx/项目名.git
git push -u origin master

然后执行

git pull 

出现 问题 git@github.com: Permission denied (publickey). Could not read from remote repository.

一、解决思路

本地的git 客户端没办法连接到远程github的 ,或者没有权限信息
我们重新生成一个key,然后配置到github,让github信任此次的请求

生成客户端的key
ssh-keygen -t rsa -C "7610.。。。@qq.com"

此时我们可以看到提示信息,在指定的目录下,有一个id_rsa.pub

验证客户端和远程github的连接情况

在客户端执行命令ssh -v git@github.com,可以看到
在最后一行有提示信息

debug1: No more authentication methods to try.
git@github.com: Permission denied (publickey).

为了使得刚才生成的id_rsa.pub 的文件生效
我们就需要在github上配置刚才生成的文件

在 github 中 setting中配置

将刚才生成的 文件内容 id_rsa.pub 添加到进去

我们再次验证

ssh -v git@github.com


可以看到此时验证通过了

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/277588.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号