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

Jenkins CLI unable to read SSH

    XMLWordPrintable

    Details

    • Similar Issues:
    • Released As:
      2.303.1

      Description

      Hello,

        We upgraded from 2.280 to 2.285 and now we are getting the following:

      _[root@~]_ _"/usr/lib/jvm/java-1.8.0/bin/java" -jar jenkins-cli.jar -s http://127.0.0.1:8080 -ssh -user "jenkins_automation" -p 53801 -i jenkins-key.pem who-am-i_
      _Mar 31, 2021 12:50:15 PM io.jenkins.cli.shaded.org.apache.sshd.common.util.security.AbstractSecurityProviderRegistrar getOrCreateProvider_
      _INFO: getOrCreateProvider(EdDSA) created instance of io.jenkins.cli.shaded.net.i2p.crypto.eddsa.EdDSASecurityProvider_
      _Mar 31, 2021 12:50:15 PM io.jenkins.cli.shaded.org.apache.sshd.common.io.DefaultIoServiceFactoryFactory getIoServiceProvider_
      _INFO: No detected/configured IoServiceFactoryFactory using Nio2ServiceFactoryFactory_
      _io.jenkins.cli.shaded.org.apache.sshd.common.SshException: No more authentication methods available_
       _at io.jenkins.cli.shaded.org.apache.sshd.common.future.AbstractSshFuture.verifyResult(AbstractSshFuture.java:126)_
       _at io.jenkins.cli.shaded.org.apache.sshd.client.future.DefaultAuthFuture.verify(DefaultAuthFuture.java:39)_
       _at io.jenkins.cli.shaded.org.apache.sshd.client.future.DefaultAuthFuture.verify(DefaultAuthFuture.java:32)_
       _at hudson.cli.SSHCLI.sshConnection(SSHCLI.java:108)_
       _at hudson.cli.CLI._main(CLI.java:285)_
       _at hudson.cli.CLI.main(CLI.java:96)_
      _Caused by: io.jenkins.cli.shaded.org.apache.sshd.common.SshException: No more authentication methods available_
       _at io.jenkins.cli.shaded.org.apache.sshd.client.session.ClientUserAuthService.tryNext(ClientUserAuthService.java:342)_
       _at io.jenkins.cli.shaded.org.apache.sshd.client.session.ClientUserAuthService.processUserAuth(ClientUserAuthService.java:277)_
       _at io.jenkins.cli.shaded.org.apache.sshd.client.session.ClientUserAuthService.process(ClientUserAuthService.java:224)_
       _at io.jenkins.cli.shaded.org.apache.sshd.common.session.helpers.AbstractSession.doHandleMessage(AbstractSession.java:502)_
       _at io.jenkins.cli.shaded.org.apache.sshd.common.session.helpers.AbstractSession.handleMessage(AbstractSession.java:428)_
       _at io.jenkins.cli.shaded.org.apache.sshd.common.session.helpers.AbstractSession.decode(AbstractSession.java:1463)_
       _at io.jenkins.cli.shaded.org.apache.sshd.common.session.helpers.AbstractSession.messageReceived(AbstractSession.java:388)_
       _at io.jenkins.cli.shaded.org.apache.sshd.common.session.helpers.AbstractSessionIoHandler.messageReceived(AbstractSessionIoHandler.java:64)_
       _at io.jenkins.cli.shaded.org.apache.sshd.common.io.nio2.Nio2Session.handleReadCycleCompletion(Nio2Session.java:358)_
       _at io.jenkins.cli.shaded.org.apache.sshd.common.io.nio2.Nio2Session$1.onCompleted(Nio2Session.java:335)_
       _at io.jenkins.cli.shaded.org.apache.sshd.common.io.nio2.Nio2Session$1.onCompleted(Nio2Session.java:332)_
       _at io.jenkins.cli.shaded.org.apache.sshd.common.io.nio2.Nio2CompletionHandler.lambda$completed$0(Nio2CompletionHandler.java:38)_
       _at java.security.AccessController.doPrivileged(Native Method)_
       _at io.jenkins.cli.shaded.org.apache.sshd.common.io.nio2.Nio2CompletionHandler.completed(Nio2CompletionHandler.java:37)_
       _at sun.nio.ch.Invoker.invokeUnchecked(Invoker.java:126)_
       _at sun.nio.ch.Invoker.invokeDirect(Invoker.java:157)_
       _at sun.nio.ch.UnixAsynchronousSocketChannelImpl.implRead(UnixAsynchronousSocketChannelImpl.java:555)_
       _at sun.nio.ch.AsynchronousSocketChannelImpl.read(AsynchronousSocketChannelImpl.java:277)_
       _at sun.nio.ch.AsynchronousSocketChannelImpl.read(AsynchronousSocketChannelImpl.java:298)_
       _at io.jenkins.cli.shaded.org.apache.sshd.common.io.nio2.Nio2Session.doReadCycle(Nio2Session.java:429)_
       _at io.jenkins.cli.shaded.org.apache.sshd.common.io.nio2.Nio2Session.handleReadCycleCompletion(Nio2Session.java:362)_
       _at io.jenkins.cli.shaded.org.apache.sshd.common.io.nio2.Nio2Session$1.onCompleted(Nio2Session.java:335)_
       _at io.jenkins.cli.shaded.org.apache.sshd.common.io.nio2.Nio2Session$1.onCompleted(Nio2Session.java:332)_
       _at io.jenkins.cli.shaded.org.apache.sshd.common.io.nio2.Nio2CompletionHandler.lambda$completed$0(Nio2CompletionHandler.java:38)_
       _at java.security.AccessController.doPrivileged(Native Method)_
       _at io.jenkins.cli.shaded.org.apache.sshd.common.io.nio2.Nio2CompletionHandler.completed(Nio2CompletionHandler.java:37)_
       _at sun.nio.ch.Invoker.invokeUnchecked(Invoker.java:126)_
       _at sun.nio.ch.Invoker.invokeDirect(Invoker.java:157)_
       _at sun.nio.ch.UnixAsynchronousSocketChannelImpl.implRead(UnixAsynchronousSocketChannelImpl.java:555)_
       _at sun.nio.ch.AsynchronousSocketChannelImpl.read(AsynchronousSocketChannelImpl.java:277)_
       _at sun.nio.ch.AsynchronousSocketChannelImpl.read(AsynchronousSocketChannelImpl.java:298)_
       _at io.jenkins.cli.shaded.org.apache.sshd.common.io.nio2.Nio2Session.doReadCycle(Nio2Session.java:429)_
       _at io.jenkins.cli.shaded.org.apache.sshd.common.io.nio2.Nio2Session.handleReadCycleCompletion(Nio2Session.java:362)_
       _at io.jenkins.cli.shaded.org.apache.sshd.common.io.nio2.Nio2Session$1.onCompleted(Nio2Session.java:335)_
       _at io.jenkins.cli.shaded.org.apache.sshd.common.io.nio2.Nio2Session$1.onCompleted(Nio2Session.java:332)_
       _at io.jenkins.cli.shaded.org.apache.sshd.common.io.nio2.Nio2CompletionHandler.lambda$completed$0(Nio2CompletionHandler.java:38)_
       _at java.security.AccessController.doPrivileged(Native Method)_
       _at io.jenkins.cli.shaded.org.apache.sshd.common.io.nio2.Nio2CompletionHandler.completed(Nio2CompletionHandler.java:37)_
       _at sun.nio.ch.Invoker.invokeUnchecked(Invoker.java:126)_
       _at sun.nio.ch.Invoker$2.run(Invoker.java:218)_
       _at sun.nio.ch.AsynchronousChannelGroupImpl$1.run(AsynchronousChannelGroupImpl.java:112)_
       _at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)_
       _at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)_
       _at java.lang.Thread.run(Thread.java:748)_
      
        The credential are correct as the following works fine:
      
      _[root@~]# ssh -i jenkins-key.pem -p 53801 jenkins_automation@localhost who-am-i_
      _Authenticated as: jenkins_automation_
      _Authorities:_
       _authenticated_
       _system_users_
       _ROLE_SYSTEM_USERS_
      

        I checked the changelog and I can see the following on 2.284: "Update Jenkins CLI to SSHD Core from 1.7.0 to 2.6.0. (pull 5206)". I am not sure if related.

       

        We are suing SSH Credentials Plugin version 1.18.2, SSH server version 3.0.3.

       

        Any suggestion would be welcome.

       

      Thanks

      Andrea

       

       

        

        

       

         

       

        Attachments

          Issue Links

            Activity

            Hide
            teilo James Nord added a comment -

            Try

            ssh me@timja2.onmicrosoft.com@localhost -p 2222 list-jobs
            freestyle
            no-restrictions
            

            See if that gives you an error.

            Show
            teilo James Nord added a comment - Try ssh me@timja2.onmicrosoft.com@localhost -p 2222 list-jobs freestyle no-restrictions See if that gives you an error.
            Hide
            timja Tim Jacomb added a comment -

            Isn’t that what I did?

            Show
            timja Tim Jacomb added a comment - Isn’t that what I did?
            Hide
            timja Tim Jacomb added a comment -

            Oh local host will check soon

            Show
            timja Tim Jacomb added a comment - Oh local host will check soon
            Hide
            timja Tim Jacomb added a comment -

            James Nord

            ➜  azure-test-env git:(master) ✗ ssh me@timja2.onmicrosoft.com@localhost -p 2222 list-jobs
            Unable to negotiate with ::1 port 2222: no matching cipher found. Their offer: aes128-ctr,aes192-ctr,aes256-ctr
            
            Show
            timja Tim Jacomb added a comment - James Nord ➜ azure-test-env git:(master) ✗ ssh me@timja2.onmicrosoft.com@localhost -p 2222 list-jobs Unable to negotiate with ::1 port 2222: no matching cipher found. Their offer: aes128-ctr,aes192-ctr,aes256-ctr
            Hide
            timja Tim Jacomb added a comment -

            Ah it works if I download a new version of the CLI, oops, my bad.

            (side issue bit weird to have log messages coming out of a CLI):

            ➜  azure-test-env git:(master) ✗ java -jar jenkins-cli-lts.jar -s http://localhost:6322/jenkins/  -ssh -user me@timja2.onmicrosoft.com -i /Users/timja/.ssh/id_rsa
            Jun 16, 2021 7:33:49 AM io.jenkins.cli.shaded.org.apache.sshd.common.util.security.AbstractSecurityProviderRegistrar getOrCreateProvider
            INFO: getOrCreateProvider(EdDSA) created instance of io.jenkins.cli.shaded.net.i2p.crypto.eddsa.EdDSASecurityProvider
            Jun 16, 2021 7:33:49 AM io.jenkins.cli.shaded.org.apache.sshd.common.io.DefaultIoServiceFactoryFactory getIoServiceProvider
            INFO: No detected/configured IoServiceFactoryFactory using Nio2ServiceFactoryFactory
            Jun 16, 2021 7:33:49 AM io.jenkins.cli.shaded.org.apache.sshd.client.config.hosts.ConfigFileHostEntryResolver reloadHostConfigEntries
            INFO: resolveEffectiveResolver(me@timja2.onmicrosoft.com@localhost:2222) loaded 4 entries from /Users/timja/.ssh/config
              add-job-to-view
                Adds jobs to view.
              apply-configuration
                Apply YAML configuration to instance
            
            Show
            timja Tim Jacomb added a comment - Ah it works if I download a new version of the CLI, oops, my bad. (side issue bit weird to have log messages coming out of a CLI): ➜ azure-test-env git:(master) ✗ java -jar jenkins-cli-lts.jar -s http: //localhost:6322/jenkins/ -ssh -user me@timja2.onmicrosoft.com -i /Users/timja/.ssh/id_rsa Jun 16, 2021 7:33:49 AM io.jenkins.cli.shaded.org.apache.sshd.common.util.security.AbstractSecurityProviderRegistrar getOrCreateProvider INFO: getOrCreateProvider(EdDSA) created instance of io.jenkins.cli.shaded.net.i2p.crypto.eddsa.EdDSASecurityProvider Jun 16, 2021 7:33:49 AM io.jenkins.cli.shaded.org.apache.sshd.common.io.DefaultIoServiceFactoryFactory getIoServiceProvider INFO: No detected/configured IoServiceFactoryFactory using Nio2ServiceFactoryFactory Jun 16, 2021 7:33:49 AM io.jenkins.cli.shaded.org.apache.sshd.client.config.hosts.ConfigFileHostEntryResolver reloadHostConfigEntries INFO: resolveEffectiveResolver(me@timja2.onmicrosoft.com@localhost:2222) loaded 4 entries from /Users/timja/.ssh/config add-job-to-view Adds jobs to view. apply-configuration Apply YAML configuration to instance

              People

              Assignee:
              teilo James Nord
              Reporter:
              andrea_lai Andrea Lai
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: