Jenkins plugin ssh-agent showing “ERROR: Failed to

2020-07-11 06:46发布

问题:

I getting error "ERROR: Failed to run ssh-add" I am trying to ssh into remote machine so

SSH credential are set Pipeline script is calling ssh-agent On executing the job I get error below

I have tried this reported bug https://issues.jenkins-ci.org/browse/JENKINS-50181 but it is not working and bug has been already resolved in latest version 1.17 which i have now. Can anyone suggest how to fix this issue.

回答1:

This is just a wild guess since this could have different reasons.

But I just had this error, and my problem was that when I created the credential in Jenkins I forgot to add a linebreak at the end of the input.

...
...<all the usual content>...
...
-----END OPENSSH PRIVATE KEY-----<linebreak needed here>