-
Bug
-
Resolution: Unresolved
-
Major
-
None
-
Jenkins ver. 2.138.1
After I installed the latest LTS I cannot connect to the Linux slave/agent anymore. The error is:
SSHLauncher{host='[OMISSIS]', port=22, credentialsId='jenkins-cred', jvmOptions='', javaPath='', prefixStartSlaveCmd='', suffixStartSlaveCmd='', launchTimeoutSeconds=210, maxNumRetries=10, retryWaitTime=15, sshHostKeyVerificationStrategy=hudson.plugins.sshslaves.verifiers.KnownHostsFileKeyVerificationStrategy, tcpNoDelay=true, trackCredentials=true}SSHLauncher{host='[OMISSIS]', port=22, credentialsId='jenkins-cred', jvmOptions='', javaPath='', prefixStartSlaveCmd='', suffixStartSlaveCmd='', launchTimeoutSeconds=210, maxNumRetries=10, retryWaitTime=15, sshHostKeyVerificationStrategy=hudson.plugins.sshslaves.verifiers.KnownHostsFileKeyVerificationStrategy, tcpNoDelay=true, trackCredentials=true}[10/09/18 10:14:36] [SSH] Opening SSH connection to [OMISSIS]:22.[10/09/18 10:14:36] [SSH] SSH host key matches key in Known Hosts file. Connection will be allowed.ERROR: Server rejected the 1 private key(s) for jenkins (credentialId:jenkins-cred/method:publickey)ERROR: Failed to authenticate as jenkins with credential=jenkins-credjava.io.IOException: Publickey authentication failed. at com.trilead.ssh2.auth.AuthenticationManager.authenticatePublicKey(AuthenticationManager.java:291) at com.trilead.ssh2.Connection.authenticateWithPublicKey(Connection.java:483) at com.cloudbees.jenkins.plugins.sshcredentials.impl.TrileadSSHPublicKeyAuthenticator.doAuthenticate(TrileadSSHPublicKeyAuthenticator.java:109) at com.cloudbees.jenkins.plugins.sshcredentials.SSHAuthenticator.authenticate(SSHAuthenticator.java:436) at com.cloudbees.jenkins.plugins.sshcredentials.SSHAuthenticator.authenticate(SSHAuthenticator.java:455) at hudson.plugins.sshslaves.SSHLauncher.openConnection(SSHLauncher.java:1214) at hudson.plugins.sshslaves.SSHLauncher$2.call(SSHLauncher.java:844) at hudson.plugins.sshslaves.SSHLauncher$2.call(SSHLauncher.java:831) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:748)Caused by: java.io.IOException: PEM problem: it is of unknown type at com.trilead.ssh2.crypto.PEMDecoder.decodeKeyPair(PEMDecoder.java:500) at com.trilead.ssh2.auth.AuthenticationManager.authenticatePublicKey(AuthenticationManager.java:225) ... 11 more[10/09/18 10:14:36] [SSH] Authentication failed.Authentication failed.[10/09/18 10:14:36] Launch failed - cleaning up connection[10/09/18 10:14:36] [SSH] Connection closed.
As a workaround, I had to re-enter the private key in https://$HOST/credentials/store/system/domain/_/credential/jenkins-cred/update using the format:
-----BEGIN RSA PRIVATE KEY----- […] -----END RSA PRIVATE KEY-----
instead of the previous one (I don't know how I entered it the first time years ago):
{[…]}