哈德森 git 错误 ssh
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/3516719/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Hudson git error ssh
提问by myusuf3
If there is anyone that can help me understand why this git repo isn't cloning that would be amazing.
如果有人可以帮助我理解为什么这个 git repo 不能克隆,那就太棒了。
I runt the same command from the terminal it works. I hoping to find out where I can put the password so the server can authenticate the connection.
我从它工作的终端运行了相同的命令。我希望找出可以将密码放在哪里,以便服务器可以对连接进行身份验证。
Please and thank you.
谢谢,麻烦您了。
ERROR: Error cloning remote repo 'origin' : Could not clone ssh://[email protected]/usr/local/repository/kdm/git/TestCaseGenerator.git
ERROR: Cause: Error performing /usr/bin/git clone -o origin ssh://[email protected]/usr/local/repository/kdm/git/TestCaseGenerator.git /var/lib/hudson/jobs/KDM_Test_Case_Generator/workspace
Command returned status code 128: Initialized empty Git repository in /var/lib/hudson/jobs/KDM_Test_Case_Generator/workspace/.git/
No protocol specified
(ssh-askpass:12523): Gtk-WARNING **: cannot open display: :0.0
Host key verification failed.
fatal: The remote end hung up unexpectedly
Trying next repository
ERROR: Could not clone repository
FATAL: Could not clone
hudson.plugins.git.GitException: Could not clone
at hudson.plugins.git.GitSCM.invoke(GitSCM.java:719)
at hudson.plugins.git.GitSCM.invoke(GitSCM.java:658)
at hudson.FilePath.act(FilePath.java:753)
at hudson.FilePath.act(FilePath.java:735)
at hudson.plugins.git.GitSCM.checkout(GitSCM.java:658)
at hudson.model.AbstractProject.checkout(AbstractProject.java:1046)
at hudson.model.AbstractBuild$AbstractRunner.checkout(AbstractBuild.java:479)
at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:411)
at hudson.model.Run.run(Run.java:1248)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
at hudson.model.ResourceController.execute(ResourceController.java:88)
at hudson.model.Executor.run(Executor.java:129)
采纳答案by Peter Tillemans
You should setup a ssh trust relationship between your repo and the git server.
您应该在您的 repo 和 git 服务器之间设置 ssh 信任关系。
You only need to do this once.
您只需执行此操作一次。
In short it goes qs follows :
简而言之, qs 如下:
Log in as the user running hudson
以运行 hudson 的用户身份登录
ssh-keygen
use an empty password
使用空密码
This creates 2 files in .ssh : id_dsa and id_dsa.pub.
这会在 .ssh 中创建 2 个文件:id_dsa 和 id_dsa.pub。
cat .ssh/id_dsa.pub
Now copy the gibberish representing the public key.
现在复制代表公钥的乱码。
ssh repo-server
Confirm you want to add the host key to known_hosts. Log in using the account accessing the repo.
确认您要将主机密钥添加到 known_hosts。使用访问 repo 的帐户登录。
cat - >>.ssh/authorized_keys
(double check you have 2 >'s or risk the wrath of your colleagues) Then paste the gibberish you just copied.
(仔细检查您是否有 2 个 >,否则可能会激怒您的同事)然后粘贴您刚刚复制的胡言乱语。
Log out and verify you can now ssh without having to provide a password.
注销并验证您现在无需提供密码即可 ssh。
This works for Unix based hosts. For github, gitosis, windows the process is similar, but of course different.
这适用于基于 Unix 的主机。对于 github、gitosis、windows 的过程是类似的,但当然是不同的。
Hudson should now be able to connect.
Hudson 现在应该可以连接了。
回答by a_fan
You have to check the following:
您必须检查以下内容:
- You are using ssh keys of the user who ran hudson daemon. For example, if user=hudson, then you should log on as hudson and generate ssh keys
- You have loaded your public key to your server (github, assembla) from correct
.ssh/id_rsa.pub
file i.e. for the same user who ran hudson daemon - You have added RSA fingerprint of your server to your
.ssh/known_hosts
file
- 您正在使用运行 hudson 守护程序的用户的 ssh 密钥。例如,如果 user=hudson,那么您应该以 hudson 身份登录并生成 ssh 密钥
- 您已将您的公钥从正确的
.ssh/id_rsa.pub
文件加载到您的服务器(github、assembla),即为运行 hudson 守护进程的同一用户 - 您已将服务器的 RSA 指纹添加到您的
.ssh/known_hosts
文件中
回答by Rodja
If all should be right but it's strangly not working, make sure your project is rally build on the slave you configured.
如果一切正常,但奇怪的是无法正常工作,请确保您的项目是在您配置的从站上建立的。
回答by bstpierre
Should that url be:
该网址应该是:
ssh://[email protected]:/usr/local/repository/kdm/git/TestCaseGenerator.git
?
?
(Missing colon after the ".net")
(“.net”后缺少冒号)