加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > Linux > 正文

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

发布时间:2020-12-14 01:44:11 所属栏目:Linux 来源:网络整理
导读:嗨,我只想将我的项目从 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 request
嗨,我只想将我的项目从 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

enter image description here

我也在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密钥,然后将最后一个命令的输出粘贴到新密钥中.

你应该好好去这一点.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读