Jenkins Git连接 [英] Jenkins Git connection

查看:778
本文介绍了Jenkins Git连接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在设置源代码管理部分中的git配置时出现此错误,存储库URL是私有的,如 exampleip:/home/project/git-repo/single_login.git not from github

 无法连接到存储库:命令git ls-remote -h exampleip:/ home / project / git-repo / single_login.git HEAD返回状态码128:
stdout:
stderr:权限被拒绝,请重试。
权限被拒绝,请重试。
权限被拒绝(publickey,gssapi-keyex,gssapi-with-mic,密码)。
致命:无法从远程存储库读取。

请确保您拥有正确的访问权限
并存在存储库。

我试图在jenkins凭证提供程序中设置用户名和密码,但仍然无法正常工作。



我为终端项目做的克隆就像这样 git clone username @ exampleip:/home/project/git-repo/single_login.git 这需要密码,一旦提供它就可以使用



我认为他以某种方式输入错误的用户/密码,任何人都有一个想法这个?

解决方案

一个类似于scp的ssh URL exampleip:/ home / project / git-repo / single_login.git 表示运行Jenkins的帐户将查找 〜/ .ssh / config 文件,并带有主机exampleip 条目。

 主机exampleip 
主机名exampleip.ip
用户名
IdentityFile / path / to / id_rsa_username

确保已注册 id_rsa_username.pub 到您的远程示例服务器,位于〜username / .ssh / authorized_keys 。然后它就会起作用。

但是你需要确定谁在运行Jenkins,以便设置〜/ .ssh / config 文件在正确的地方。


Getting this error while setting the git config in the Source Code Management section, the repository url is private like this exampleip:/home/project/git-repo/single_login.git not from github

Failed to connect to repository : Command "git ls-remote -h exampleip:/home/project/git-repo/single_login.git HEAD" returned status code 128:
stdout:
stderr: Permission denied, please try again.
Permission denied, please try again.
Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

i tried setting up username and password in the jenkins credential provider and still doesnt work.

the clone that i do for the project in terminal was like this git clone username@exampleip:/home/project/git-repo/single_login.git this ask for password that once supplied it works

i think that somehow he is inputing the user/pass in a wrong way, anybody have an idea about this?

解决方案

An scp-like ssh URL exampleip:/home/project/git-repo/single_login.git means the account running Jenkins will look for an ~/.ssh/config file, with an Host exampleip entry.

Host exampleip
  HostName exampleip.ip
  User username
  IdentityFile /path/to/id_rsa_username

Make sure id_rsa_username.pub is registered to your remote example server, at ~username/.ssh/authorized_keys. Then it will work.

But you need to make sure of who is running Jenkins, in order to set the ~/.ssh/config file at the right place.

这篇关于Jenkins Git连接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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