我正在Windows Server 2016上运行的Jenkins 2.152中创建一个作业,需要从在bitbucket.org托管的git repo中拉取代码。 我已经通过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凭据中私钥的预期格式吗?或者也许有其他事情我可以检查。
非常感谢任何帮助。