目录

一:问题描述

二:解决过程

1,增加账号及邮箱

2,添加秘钥:

3,获取公钥并将其设置到云效里面

4,宝塔终端 解除密码

三:解决截图


一:问题描述

我们公司的版本仓库用的是阿里云效,因为前一阵前任技术负责人离开公司,我登录阿里云效将其移出了团队。结果,发现我们的线上环境git pull时出现了“找不到代码库,请确认是否有权限且代码库路径正确”,这样的报错,英文的报错信息是:fatal: Could not read from remote repository

查阅资料后,得出原因:线上环境使用的ssh连接应该就是前任技术的,看来我需要重新创建一个,以我的账号创建。
经过,大约2小时的摸索努力,终于弄好了,现在将其过程分享给大家。

二:解决过程

1,增加账号及邮箱

(1)云效平台,我的账号绑定邮箱29****39@qq.com
(2)查看当前的账号及邮箱

git config user.name
git config user.email

(3)设置新的账号邮箱

git config --global user.name "su****hui"
git config --global user.email "29****39@qq.com"

2,添加秘钥:

ssh-keygen -t rsa -C "29****39@qq.com"//备用
ssh-keygen -t rsa -b 4096 -C "29****39@qq.com"//这个命令可以不用设置密码
ssh-add ~/.ssh/id_rsa
Enter passphrase (empty for no passphrase),
输入:123456
再次输入:123456

详细命令如下:

fatal: Could not read from remote repository.Please make sure you have the correct access rights
and the repository exists.
[root@VM-0-14-centos yunding-admin]# ssh-keygen -t rsa -b 4096 -C "29****39@qq.com"
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa)://直接回车
/root/.ssh/id_rsa already exists.
Overwrite (y/n)? y
Enter passphrase (empty for no passphrase)://输入的123456
Enter same passphrase again://再次输入的123456
Your identification has been saved in /root/.ssh/id_rsa.
Your public key has been saved in /root/.ssh/id_rsa.pub.
The key fingerprint is:
SHA256:CLLFyI7onqV2mDS9KRs3vKM1DgdUEyCYhwLM257sH1g 29****39@qq.com
The key's randomart image is:
+---[RSA 4096]----+
|B+.+.            |
|*+oo.            |
|.o* +            |
|o+ = . .         |
|o.* .E. S        |
|.oo=o            |
|.+=Xo.           |
|.=@*+ .          |
|.*=oo.           |
+----[SHA256]-----+

3,获取公钥并将其设置到云效里面

(1)获取公钥:vim /root/.ssh/id_rsa.pub
(2)拷贝内容:
ssh-rsa AAAA******c2EAAAADAQABAAACAQDHPvLYBStqVUKarcLOe9PRkJbQMaeI1W74ypk1UPYnFfuBcJ2*****wN3chTyEzO+27zgBot5oeuuHv9g8dav+qIasWqU9XIhwvpJIRHxt4V4kO6QUP0NAdaKVSN******o0Hgza/xd3kU/ytENL/nDJzdI4oJXtq5n6cZJBQO92cquvzt9Na7UvaacNRbBILQOZgQOrGO******MiVeuY1HTgrqeWOIoJtZ94b9gV2KlwQhU+PtHsefvhBelIOmXmjPsAiyWIQbsAZFbxtQd9h******X6FFGsjFyvyD/iGXELYsPmjGD6L9qJgXrjcPS7+1Zyo4EWCuZuNNAuhPpoRubjU62huq/pm******5o9s9s8auu1kUS70pBh1hBxn4OcDNG+iFI+n8ZGv5Ot+rs1PGs4jo58AOS2J7eibXHlTuy0******CHKFljmT01gvdtdQmwueXh4nBYTapMvryOtcj33zEPLEBSB56xlWxZMUajpZoMZaDfVEbNvow+RcME7qg25RG0zhwnqTqGJPfAsrRm1SvhpQQPcpQlbe21NwqsmmTI3mJOoJYRtluspHiiYaDyf9+P7ieLjnx/DyBTUzqvDtz8XAK2tC6cT4Ph7RxiOrIQrXUuxUcdrQkmE4+dEBSySgTGlrrSFThp00nLjBwHh5vD/wfWinZ92WfMuUpQ== 29****39@qq.com
(3)云效-个人设置-SSH公钥-添加SSH公钥-保存

其中:作用范围为全部

4,宝塔终端 解除密码

命令:ssh-keygen -p
输入密码:直接回车
输入旧密码:123456
确认新密码:回车
再次确认新密码:回车

三:解决截图

关于Git使用:fatal: Could not read from remote repository.的报错问题解决相关推荐

  1. git解决 “fatal: Could not read from remote repository.“

    问题描述: 在使用Git将本地仓库推送到远程仓库的时候,发生了如下错误:"fatal: Could not read from remote repository." 问题原因: ...

  2. Git遇到fatal: Could not read from remote repository.解决方案

    1. 生成sshkey ssh-keygen -t rsa 执行完毕上面命令之后,按几次回车 2.查看公钥的内容,复制到git的sshkey位置 cat ~/.ssh/id_rsa.pub 类似于:每 ...

  3. 解决git@github.com: Permission denied (publickey). fatal: Could not read from remote repository. Pleas

    今天用idea提交代码到github上,push后报错 git@github.com: Permission denied (publickey). fatal: Could not read fro ...

  4. git@github.com:Permission denied(publickey).fatal: Could not read form remote repository错误

    文章目录 前言 问题分析 解决方法 配置客户端 配置服务端 验证 前言 在使用goland从github下载依赖时(git clone github.com/gin-gonic/gin)出现git@g ...

  5. git clone报错:Permission denied (publickey). fatal: Could not read from remote repository...

    原文:git clone报错:Permission denied (publickey). fatal: Could not read from remote repository- 今天clone一 ...

  6. fatal: ‘origin‘ does not appear to be a git repository fatal: Could not read from remote repository.

    fatal: 'origin' does not appear to be a git repository fatal: Could not read from remote repository. ...

  7. Git push错误,Unauthorized fatal: Could not read from remote repository.未验证不能提交

    错误 git push -u origin master Unauthorized fatal: Could not read from remote repository. (Bitbucket - ...

  8. mac下git使用ssh时候的一个小问题:Permission denied (publickey). fatal: Could not read from remote repository.

    换了新电脑,配置了git的ssh keys之后就没怎么动过了,反正配置轻车熟路,就没有测试过. 今天更新一个项目的时候,怎么都更新不了,提示如下: > git clone git@github. ...

  9. gitHub报错之git@github.com: Permission denied (publickey). fatal: Could not read from remote repository

    前言 当我们在新的电脑环境,本地上传到自己的github储存仓库就会出现时密钥不匹配,被拒绝上传. 第一句 git@github.com: Permission denied (publickey). ...

最新文章

  1. itstime后面跟什么_一文讲透什么是引流
  2. linux ipmitool检测内存,一种基于ipmitool工具循环侦测内存的方法与流程
  3. 应用程序框架实战三十六:CRUD实战演练介绍
  4. c++ 多线程 垃圾回收器_并行并发CMS垃圾回收器:-XX:+UseConcMarkSweepGC
  5. oracle触发器记录所有dml,Oracle DML类型触发器
  6. c# sha1签名 微信_微信公众号开发——微信JSSDK使用(踩坑)
  7. 开发者70行代码破解苹果OSX远程锁定安全功能
  8. Git最好的CRLF(回车,换行)处理策略是什么?
  9. 关于网络安全检查的问题
  10. php+将json转字符串,php实现json转字符串的方法
  11. 嵌入式linux中文语言支持,嵌入式linux无法显示中文问题
  12. 怎样在xlsx中加入图片——怎样在excel中加入图片
  13. Scrapy-Redis使用教程将现有爬虫修改为分布式爬虫
  14. php对接WPS开放平台word编辑demo
  15. 牛津词典 2018 年度词汇 ——「有毒」! 1
  16. 【微信小程序系列】小程序简单连接后端数据库完整示例(附免费下载的源码)(Servlet)
  17. Java50道经典编程题:(七)输出不同种类字符个数 ——字符串的遍历及循环结构的使用
  18. 展锐android r kernel 快速编译
  19. mysql如何重复数据合并_mysql合并重复数据
  20. 系统在此应用程序堆栈溢出_Web应用程序:在开始之前选择正确的技术堆栈

热门文章

  1. 琥珀色の遺言 iphone 攻略
  2. Java经典问题算法大全 Java小程序
  3. Python对json数据的提取
  4. 北京工作三年程序员,2018年4~5月面试经历
  5. JAVA | 什么是微服务?
  6. 四神分析报告设计器 1.1.9更新
  7. 孩子学习不好是来报恩的
  8. python 囚徒困境_40行Python代码实现“旅行者困境“演化过程
  9. 1102 Invert a Binary Tree (25point(s))
  10. 用户权限验证的两种方法