简体   繁体   English

使用gitlab和jenkins的主机密钥验证失败

[英]Host key verification failed using gitlab and jenkins

I get Host key verification failed error whenever I try to put my GITLAB git address into Jenkins. 每当我尝试将GITLAB git地址放入Jenkins时,都会收到主机密钥验证失败错误。

I've tried: - using multiple different SSH paths. 我尝试过:-使用多个不同的SSH路径。 Including removing : and replacing /. 包括删除:和替换/。 Used http - I've ssh and tried to run the command in the terminal, when prompted to say y/n I pressed Y. - It works with Github. 使用http-我已经ssh并尝试在终端中运行命令,当系统提示您按y / n时,我按Y。-它与Github一起使用。 - I've tried going to my jenkins/.ssh/ida_pub and adding my keys. -我尝试去我的jenkins / .ssh / ida_pub并添加我的密钥。

Failed to connect to repository : Command "/usr/local/git/bin/git ls-remote -h git@:/.git HEAD" returned status code 128: stdout: stderr: Host key verification failed. 无法连接到存储库:命令“ / usr / local / git / bin / git ls-remote -h git @:/。git HEAD”返回状态码128:stdout:stderr:主机密钥验证失败。 fatal: Could not read from remote repository. 致命:无法从远程存储库读取。

Please make sure you have the correct access rights and the repository exists. 请确保您具有正确的访问权限,并且存储库存在。

If you make the repo you are trying to connect to public in Gitlab (Settings -> Edit Project -> Public mode) you should be able to connect using http (but only http). 如果您要创建存储库,则尝试在Gitlab(设置->编辑项目->公共模式)下连接到公共站点,则应该可以使用http(但只能是http)进行连接。

If the repo is not public you will need to install an SSH key on Jenkins that has permissions to access the repo. 如果该存储库不是公开的,则需要在Jenkins上安装一个有权访问该存储库的SSH密钥。 My understanding is that the Jenkins git plugin does not currently use the SSH credentials already stored in Jenkins so you will need to install the key on the master and slaves that will run this build. 我的理解是, Jenkins git插件当前不使用Jenkins中已经存储的SSH凭据,因此您将需要在运行此版本的主服务器和从服务器上安装密钥。 How you do this will depend on your OS but I find it easiest to use an SSH config file on Linux. 如何执行此操作将取决于您的操作系统,但我发现在Linux上使用SSH配置文件最容易。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM