Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-72903

sshCommand Auth fail with ed25519 key

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • ssh-steps-plugin
    • jenkins 2.440.1-lts-jdk17
      ssh-steps 2.0.68.va_d21a_12a_6476
      ssh-credentials 308.ve4497b_ccd8f4
      jsch 0.2.16-86.v42e010d9484b_

      After I upgraded from 2.414.3-lts-jdk11 to 2.440.1 and upgrade some plugins that sshCommand got exception.

      I was using private key with the ed25519 type at first. I then tried changing the private key to the rsa type, and it worked!

      I also try to create a new ed25519 key but still encount same problem.

      Our code as follow:

      def remote = [:]
      remote.name = 'xxxx'
      remote.host = 'xxxx'
      remote.port = 22
      remote.allowAnyHosts = true
      steps.withCredentials([steps.sshPrivateKey(credentialsId: Const.KEY_NAME, keyFileVariable: 'identity', passphraseVariable: '', usernameVariable: 'userName')]) {
          remote.user = steps.userName
          remote.identityFile = steps.identity
          steps.sshCommand(command: "ls /root", remote: remote, failOnError: true)
      } 

      Traceback: 
      [SEVERE] com.jcraft.jsch.JSchException: Auth fail for methods 'publickey,password'
      com.jcraft.jsch.Session.connect(Session.java:521)
      com.jcraft.jsch.Session.connect(Session.java:199)
      com.jcraft.jsch.Session$connect$1.call(Unknown Source)
      org.hidetake.groovy.ssh.connection.ConnectionManager.connectInternal(ConnectionManager.groovy:107)
      java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      java.base/java.lang.reflect.Method.invoke(Method.java:566)
      org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:98)
      groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
      org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:352)
      groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1034)
      org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.callCurrent(PogoMetaClassSite.java:68)
      org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:193)
      org.hidetake.groovy.ssh.connection.ConnectionManager$_connectInternal_closure1.doCall(ConnectionManager.groovy:85)
      org.hidetake.groovy.ssh.connection.ConnectionManager$_connectInternal_closure1.doCall(ConnectionManager.groovy)
       

            nrayapati Naresh Rayapati
            alexsue sue
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: