问题背景

代码托管在阿里云Code, Centos7 服务器上部署了Jenkins 。

执行完不设置交换秘密生成SSH密钥对:

ssh-keygen -t rsa -C "fairy_xingyun@hotmial.com" -N ''

但是当在Jenkins 上关联项目的时候报错了。

错误内容如下:

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

我尝试了将近三个小时,开始以为是怀疑哪里的配置搞错了。

我重复生成密钥对不下十次,然而始终是这个错误。

我在linux 服务器上,直接执行git clone https://xxxx.git 没有问题。

但是每次尝试链接,后台自动给我提示这个

我都开始怀疑人生了,到底是哪里不对呢?

直到我搜索到这篇文章:jenkins学习一(使用Git拉取代码遇到的问题)

这个红色的部分?我看了下jenkins 上配置的没有这个红色部分内容,阿里云Code 配置的SSH KEY 中也没有。

于是我打开了id_rsa ,注意不是id_rsa.pub 。

id_rsa 是私钥

id_rsa.pub 是公钥

解决方案


阿里云code ,即代码仓库配置的SSH KEY 应该是公钥,id_rsa.pub 文件

Jenkins ,配置的应该是私钥,id_rsa 文件!!!

刚开始想当然地以为Jenkins 和代码仓库配置的都应该是SSH KEY 公钥呢。。。

本篇完~

参考资料

  • Permission denied (publickey). fatal: Could not read from remote repository.
  • public key always asking for password and keyphrase

解决方案:stderr: Permission denied (publickey). fatal: Could not read from remote repository相关推荐

  1. 解决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 ...

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

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

  3. 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一 ...

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

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

  5. MAC电脑gitt@github.com: Permission denied (publickey). fatal: Could not read from remote repository

    本地上传代码时,执行命令:git push -u origin master遇到下面错误提示 gitt@github.com: Permission denied (publickey). fatal ...

  6. 报错git@gitee.com: Permission denied (publickey). fatal: Could not read from remote repository

    报错如下: git@gitee.com: Permission denied (publickey). fatal: Could not read from remote repository. Pl ...

  7. Permission denied (publickey). fatal: Could not read from remote repository.

    博主在github上下载tiny face的的源代码的时候,遇到git clone命令为:git clone --recursive git@github.com:peiyunh/tiny.git 而 ...

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

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

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

    在使用git拉取文件时说没有权限,错误如下图所示.错误原因是没有进行SSH密钥是设置. 解决方法:(linux环境下),其他环境请转到它的主页面. 1.检测是否存在ssh keys ls -al ~/ ...

最新文章

  1. metasploit 一款开源的渗透测试框架
  2. 那些年,我在游戏开发中改过的bug:坑爹的Vista与中间件
  3. beta 圆桌桌 4
  4. Linux环境安装zookeeper3.5.5后,总是启动不了
  5. 小程序iconfont报错_【经验】开发微信小程序经验总结
  6. java 拟合曲线_如何通过指数曲线拟合数据
  7. 用 TigerVNC 实现 Linux 远程桌面
  8. 太原理工大学ICPC队介绍(2021版)
  9. 简单的遗传算法实例(MATLAB版)
  10. 49 张图详解 WiFi 的 26 个知识点
  11. 配置环境变量时Path单行显示问题
  12. 运行java -version出错 Error: could not open `\lib\amd64\jvm.cfg‘
  13. python语句中str_python中str是什么意思
  14. Peeking inside LuaJIT(窥探LuaJIT)
  15. 大二第六周(逐渐暴躁的一周)
  16. 关于如何在win 10 中完成 ie 11 浏览器使用的解决方案(win7 升级 ie 11)
  17. js判断两个时间是否超过一年
  18. SAP 客户信贷重建一则
  19. 文件路径问题( ./ 和 ../ 和 @/ )
  20. 【GD32F427开发板试用】三、USB转CAN功能开发与试用总结

热门文章

  1. word-break:break-all 打散文字,强制对齐
  2. arcgis server与portal解除联合的三种方式
  3. 仪表板展示|用DataEase开源工具秀出你的王者荣耀战绩
  4. 如何打开dwg文件是比较的方便的
  5. linux 字节类型,int数据类型占几个字节?
  6. 使用alist将云盘映射为WebDAV
  7. USBCAN卡和台达AS228T通信
  8. 基于java房产销售系统计算机毕业设计源码+系统+lw文档+mysql数据库+调试部署
  9. 关于EndNote 中文GB/T7144文献页码及括号不全的解决方法
  10. 你笑马保国“耗子尾汁”,鬼畜笑你“娱乐至死”