Reputation: 1739
I'm expericing the following error when trying to use the Publish Over SSH plugin to jenkins when using a different key.
jenkins.plugins.publish_over.BapPublisherException: Failed to add SSH key. Message [invalid privatekey: TheKey]
I've tried different alternatives of using the path to key and the key field itself.
Has anyone experienced / solved this issue?
Upvotes: 1
Views: 6382
Reputation: 2613
If someone came across this type of error.
Jenkins "Publish Over SSH plugin" accept private key in OpenSSH format format.
Please use below steps, to convert private key in OpenSSH format. Using Putty gen.
Copy and paste the private key into the Key section of Jenkins SSH Server. Enter Passphrase.
Click on "Test Configuration" button, "Success" :)
Upvotes: 5
Reputation: 469
Since you are using a different key, you will have a public and private key pair. The public key has to be added to the target server autorized_keys
file with in the <$HOME user>/.ssh/
and the private key has to configured in the Jenkins either using the path to key and the key field itself.
Upvotes: 0
Reputation: 10382
In your path (to the key), do you have both public and private keys in this folder?
I think It's mandatory when you pair 2 machines.
Upvotes: 0