I can authenticate successfully with putty
on the server with my private key
and passphrase. But when I try to do it with jenkins publish o
I ran into the same issue today and it turned out i was accidentally supplying the path to the public key instead of the private one.
So the "path to key" should be something like
.ssh/id_rsa
instead of
.ssh/id_rsa.pub
I think as it says this is a authentication issue:
Use password authentication, or use a different key Selecting this option will produce 3 more configuration boxes that mirror the options available for the Jenkins SSH Key.
Passphrase / Password If either Path to key or Key are configured then this is the passphrase to use with the encrypted key. If no key is configured then this is the password that will be used for password authentication.
Path to key See description above.
Key See description above.
Disable exec This option will remove the ability to execute commands using this configuration.
LINK HERE
Just copy jenkins-user's id_rsa.pub to the end of ~/.ssh/authorized_keys on remote host.
Check that the public key is in the .ssh/authorized_keys
file on the target server, even if the target server is the same as the jenkins server. I had what is probably the same problem, and it turned out that I needed this, even though ssh localhost
worked fine.
(Addendum: also check that the jenkins server has the target server in its .ssh/known_hosts
file, as that can affect this as well.)