我在使用基础亚马逊ami linux的Ec2上-我已经安装了jenkins,但是当我从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命令行克隆了仓库,但jenkins无法。
我已经将〜/ .ssh文件复制到/var/lib/jenkins/.ssh
我已经将github添加到已知主机,并且我用光了所有解决方案。有人知道我要去哪里错吗?有没有办法让詹金斯显示它正在使用的公钥,并且我可以调试它是否使用了正确的公钥?
我删除了回购的名称,因为它是私人回购
该错误似乎是:主机密钥验证失败。
您应该以Jenkins用户身份登录到Jenkins主机并运行:
ssh git@github.com
然后对有关主机密钥的提示回答是。这仅需要执行一次。
或者,您可以在〜jenkins / .ssh / config中添加“ StrictHostKeyChecking no”。