jenkins / hudson无法连接到github repo

我在Ec2与基地的亚马逊ami linux – 我已经安装了詹金斯,但是当我从github拉取回,我被给以下错误:

Building in workspace /var/lib/jenkins/workspace/build social
Checkout:build social / /var/lib/jenkins/workspace/build social - hudson.remoting.LocalChannel@5c7b21b
Using strategy: Default
Cloning the remote Git repository
Cloning repository origin
ERROR: Error cloning remote repo 'origin' : Could not clone git@github.com:adulion/.git
hudson.plugins.git.GitException: Could not clone git@github.com:adulion/.git
    at hudson.plugins.git.GitAPI.clone(GitAPI.java:245)
    at hudson.plugins.git.GitSCM$2.invoke(GitSCM.java:1117)
    at hudson.plugins.git.GitSCM$2.invoke(GitSCM.java:1059)
    at hudson.FilePath.act(FilePath.java:832)
    at hudson.FilePath.act(FilePath.java:814)
    at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1059)
    at hudson.model.AbstractProject.checkout(AbstractProject.java:1218)
    at hudson.model.AbstractBuild$AbstractRunner.checkout(AbstractBuild.java:581)
    at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:470)
    at hudson.model.Run.run(Run.java:1421)
    at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
    at hudson.model.ResourceController.execute(ResourceController.java:88)
    at hudson.model.Executor.run(Executor.java:238)
Caused by: hudson.plugins.git.GitException: Command "git clone --progress -o origin git@github.com:adulion/.git /var/lib/jenkins/workspace/build social" returned status code 128:
stdout: Cloning into /var/lib/jenkins/workspace/build social...

stderr: Host key verification failed.
fatal: The remote end hung up unexpectedly

我已经为当前安装jenkins的用户生成了一个密钥,并使用git命令行设法克隆了repo,但是jenkins不能。

我把〜/ .ssh文件复制到/var/lib/jenkins/.ssh

我已经将github添加到已知的主机,我已经用尽了解决方案。任何人都知道我在哪里错了?有没有办法让jenkins显示它正在使用的公钥,如果使用正确的公钥,我可以调试?

我删除了repo的名字,因为它是一个私人回购

错误似乎是:主机密钥验证失败。

您应该登录您的Jenkins主机作为Jenkins用户并运行:

ssh git@github.com

然后回答是关于主机密钥的提示。这只需要做一次。

或者,您可以向〜jenkins / .ssh / config中添加“StrictHostKeyChecking no”。

http://stackoverflow.com/questions/10224574/jenkins-hudson-cant-connect-to-github-repo

本站文章除注明转载外,均为本站原创或编译
转载请明显位置注明出处:jenkins / hudson无法连接到github repo