詹金斯& Github不使用SSH密钥 [英] Jenkins & Github not using SSH Key

查看:131
本文介绍了詹金斯& Github不使用SSH密钥的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经将Jenkins设置为从Github上的专用存储库中获取特定作业。看起来Jenkins并没有使用SSH密钥,尽管我已经生成了私钥/公钥,并将其作为部署密钥添加到github中。



当我从詹金斯用户克隆克隆,我被提示输入用户名和密码。为什么不使用我的〜/ .ssh / id_rsa.pub键?

谢谢

解决方案

刚刚发生同样的问题,您可以这样做:

<1>以jenkins用户身份登录

  sudo su jenkins 



<2>为jenkins用户生成密钥:

  ssh-keygen -t rsa 

3)在GitHub的回购管理部分输入id_rsa.pub作为部署密钥



或甚至更好:


  • 为jenkins创建一个Github用户

  • 在用户中添加ssh密钥个人资料信息

  • 将jenkins guthub用户添加为您项目的协作者




Vincent


I've setup Jenkins to pull from a private repository on Github for a specific job. It appears the SSH key is not being used by Jenkins, despite the fact that I have generated a private/public key and added it to github as a deploy key.

When I git clone from the Jenkins user, I'm prompted for a username and password. Why isn't it using my ~/.ssh/id_rsa.pub key?

Thanks

解决方案

Just had the same problem, here is what you can do :

1) Login as jenkins users

sudo su jenkins

2) Generate keys for the jenkins user :

ssh-keygen -t rsa

3) Enter the id_rsa.pub as deploy key in the admin section of your repo on GitHub

Or even better :

  • Create a Github user for jenkins
  • Add the ssh key in the user profile information
  • Add the jenkins guthub user as a collaborator on your project

Hope this helps, Vincent

这篇关于詹金斯&amp; Github不使用SSH密钥的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆