我正在运行一个与Docker主机通信的Jenkins容器。我创建了一个管道来利用GitHub存储库。但是当我进行构建时,它给出了一个错误,并在日志中显示以下消息:
using GIT_SSH to set credentials
Verifying host key using known hosts file
You're using 'Known hosts file' strategy to verify ssh host keys, but your known_hosts file does not exist, please go to 'Manage Jenkins' -> 'Configure Global Security' -> 'Git Host Key Verification Configuration' and configure host key verification.
我在容器中生成了ssh密钥。我添加了github上的公钥和用于构建的git用户的私钥。
在容器中,生成的密钥位于路径中:/root/.ssh/
我在容器中运行以下命令来测试与github的通信:ssh -T git@github.com
。
- 命令输出**:你好campos!你已经成功通过身份验证,但GitHub不提供shell访问。
我不理解这个错误。你能帮我吗?
1条答案
按热度按时间brqmpdu11#
在管道中,我将master更改为main。这就解决了问题。