【发布时间】:2019-05-07 06:32:01
【问题描述】:
我正在创建一个在 Windows Server 2016 上运行的 Jenkins 2.152 中的作业,该作业需要从 bitbucket.org 上托管的 git 存储库中提取。 我通过 git-bash 测试了 ssh 密钥,所以我知道它可以工作并且没有密码。 当我尝试对 Jenkins 使用相同的私钥时,我收到一条错误消息。
Failed to connect to repository : Command "git.exe ls-remote -h
git@bitbucket.org:mygroup/myrepo HEAD" returned status code 128:
stdout:
stderr: Load key
"C:\\Users\\JE~1\\AppData\\Local\\Temp\\ssh2142299850576289882.key": invalid format
git@bitbucket.org: Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
凭据设置为
scope: Global
user: git
Private Key -> Enter Directly -> copy and past - generated by ssh-keygen -t rsa in gitbash
Passphrase: empty
ID: empty
description: bitbucket.org
我注意到在另一个 Windows Jenkins 服务器上,私钥每行的字符数不同
有人知道 Jenkins 凭证中私钥的预期格式是什么吗?或者也许还有其他的东西我可以检查。
非常感谢任何帮助。
【问题讨论】: