我正在尝试将Jenkins中的GitHub企业的一个存储库设置为默认的拉源。在我们的项目中,Jenkins习惯于在我们推动某些更改时自动构建整个代码库。在我们在项目空间使用本地安装的GIT之前。现在我们要迁移到他。
我在Configure > Source Code Management tab > Repository URL > git@github.com:project/repo上做的改变。
在一个强有力的Build Now之后,我们得到了日志错误:
ERROR: Error cloning remote repo 'origin'
hudson.plugins.git.GitException: Command "git fetch --tags --progress git@github.com:project/repo +refs/heads/*:refs/remotes/origin/*" returned status code 128:
stdout:
stderr:
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that a host key has just been changed.
The fingerprint for the ECDSA key sent by the remote host is
SHA256:ZjDIk3kbdyojRjqiBBfXS6xOHF+y+9bzcbZypukADHA.
Please contact your system administrator.
Add correct host key in <jenkins_home>/.ssh/known_hosts to get rid of this message.
Offending ECDSA key in <jenkins_home>/.ssh/known_hosts:49
Password authentication is disabled to avoid man-in-the-middle attacks.
Keyboard-interactive authentication is disabled to avoid man-in-the-middle attacks.
X11 forwarding is disabled to avoid man-in-the-middle attacks.
ERROR: Permission to project/repo.git denied to deploy key
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.我在Jenkins没有任何读/写访问权限,并要求我们的Jenkins管理员根据错误在<jenkins_home>/.ssh/known_hosts上删除第49行。
他这样做了,他还和我们分享了id_rsa.pub和id_ecdsa.pub。尝试将这些密钥添加为项目/回购上的部署密钥。
id_rsa.pub,我收到一条Key is already in use消息。id_ecdsa.pub作为deploy成功地添加了。但我还是收到了一条错误信息:
Failed to connect to repository : Command "git ls-remote -h git@github.com:project/repo HEAD" returned status code 128:
stdout:
stderr: ERROR: Permission to project/repo.git denied to deploy key
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.还尝试了通过将Jenkins服务器的特定存储库路径存储在Webhooks上,但没有发现任何更改:
https://<jenkins_server>:8080/job/<repo_name>/
建议/帮助将受到高度赞赏。谢谢!
发布于 2017-04-10 16:25:37
看上去你用的是多个键。除非另有通知,SSH将加载默认密钥。
创建SSH配置文件
当您有多个标识文件时,创建一个SSH配置文件机制来为您的各种身份创建别名。 您可以使用许多参数和不同的方法构造SSH配置文件。 本例中使用的别名条目的格式是: 主机别名HostName IdentityFile ~/..ssh/identity 要为两个标识(workid和personalid)创建一个配置文件,您可以执行以下操作:
Open a terminal window.
Edit the ~/.ssh/config file. 如果您没有配置文件,请创建一个配置文件。
为每个标识组合添加别名,例如:
Host host1
HostName <domain1>
IdentityFile ~/.ssh/key1
Host host2
HostName <domain2>
IdentityFile ~/.ssh/key2在您的例子中,域应该是相同的,并添加您的两个键:id_rsa,id_ecdsa
发布于 2021-05-28 06:28:48
https://stackoverflow.com/questions/43328262
复制相似问题