Linux   发布时间:2022-04-01  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了从linux中的jenkins连接时,git repository出现403错误大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。

概述

嗨,我只想将我的项目从 github配置为jenkins以生成构建. 我收到了以下错误 Failed to connect to repository : Command "/usr/bin/git ls-remote -h https://github.com/xxxxx/yyyyy.git HEAD" returned status code 128: stdout: stderr: e
嗨,我只想将我的项目从 github配置为jenkins以生成构建.
我收到了以下错误

Failed to connect to repository : Command "/usr/bin/git ls-remote -h 
https://github.com/xxxxx/yyyyy.git HEAD" 
returned status code 128:
stdout: 
stderr: error: The requested URL returned error: 403 Forbidden while 
accessing https://github.com/xxxxx/yyyyy.git/info/refs

fatal: http request Failed

从linux中的jenkins连接时,git repository出现403错误

我也在Global Tool Configuration中添加了git路径.我在linux centos服务器上安装了jenkins.

我在stackoverflow中发现了几个类似的问题但是没有给出解决方

谁能告诉我这可能有什么问题?
提前致谢

解决方法

尝试创建SSH密钥.这将允许您的jenkins服务器和Github之间进行无密码通信.

jenkins服务器(以root身份)运行以下命令:

sudo su -s /bin/bash jenkins
cd ~
ssh-keygen -t rsa  (Hit enter for all prompts)
cat .ssh/id_rsa.pub

然后,登录到github UI,转到SSH密钥,然后将最后一个命令的输出粘贴到新密钥中.

你应该好好去这一点.

大佬总结

以上是大佬教程为你收集整理的从linux中的jenkins连接时,git repository出现403错误全部内容,希望文章能够帮你解决从linux中的jenkins连接时,git repository出现403错误所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。