Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/ssh/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
无法在jenkins签出外部git回购_Git_Ssh_Openshift - Fatal编程技术网

无法在jenkins签出外部git回购

无法在jenkins签出外部git回购,git,ssh,openshift,Git,Ssh,Openshift,我让詹金斯上openshift。我可以做以下工作,它的工作 [jenkins-<USER>.rhcloud.com data]\> ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -i /var/lib/openshift/<NUMBERED DIRECTORY>/app-root/data/.ssh/jenkins_id_rsa git@github.com Warning: Perm

我让詹金斯上openshift。我可以做以下工作,它的工作

[jenkins-<USER>.rhcloud.com data]\> ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -i /var/lib/openshift/<NUMBERED DIRECTORY>/app-root/data/.ssh/jenkins_id_rsa git@github.com
Warning: Permanently added 'github.com,207.97.227.239' (RSA) to the list of known hosts.
PTY allocation request failed on channel 0
Hi <USER>! You've successfully authenticated, but GitHub does not provide shell access.
          Connection to github.com closed.
[jenkins-.rhcloud.com data]\>ssh-o strickhostkeychecking=no-o UserKnownHostsFile=/dev/null-i/var/lib/openshift//app root/data/.ssh/jenkins\u id\u rsagit@github.com
警告:已将“github.com,207.97.227.239”(RSA)永久添加到已知主机列表中。
通道0上的PTY分配请求失败
你好您已成功通过身份验证,但GitHub不提供shell访问。
与github.com的连接已关闭。
所以它确实连接到github…甚至我从shell克隆了它

但当我尝试将回购添加到jenkins作业中时,会出现以下错误。这是私人回购

Failed to connect to repository : Command "git ls-remote -h git@github.com:<USER>/test.git HEAD" returned status code 128:
stdout:
stderr: Host key verification failed.
fatal: The remote end hung up unexpectedly
无法连接到存储库:命令“git ls remote-h”git@github.com:/test.git HEAD“返回的状态代码128:
标准:
stderr:主机密钥验证失败。
致命:远程端意外挂起

Jenkins可能以
Jenkins
的身份运行,并且您接受了
的主机密钥。您可以通过将命令
whoami
添加到构建步骤中来确认这一点,并确认
Jenkins
中的用户与shell中的用户不同

一种解决方案是以
jenkins
身份登录并接受github的密钥


另一种方法是将行从github的~/.ssh/known_hosts复制到jenkins文件夹~jenkins/.ssh/known_hosts中的已知_hosts。

jenkins可能以
jenkins
的身份运行,并且您接受了
的主机密钥。您可以通过在构建步骤中添加命令
whoami
来确认这一点
jenkins
中的用户与shell中的用户不同

一种解决方案是以
jenkins
身份登录并接受github的密钥


另一种方法是从github的~/.ssh/known_hosts复制该行,并将其复制到jenkins文件夹~jenkins/.ssh/known_hosts中的known_hosts。

在openshift上,known_hosts是不可编辑的。另外,jenkins是内置的而不是build.ok,那么在openshift上可能会有帮助,已知的_主机是不可编辑的。另外,jenkins是内置的,没有内置。好的,那可能会有帮助