• 2.303.1

      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

       

       

        

        

       

         

       

          [JENKINS-65273] Jenkins CLI unable to read SSH

          Andrea Lai added a comment -

          You are right. It seems something happen in 2.284 that broke our automation. Do we have any workaround or anything that we can do to make it work? We are Okay with 2.283 for awhile but we would need to upgrade in the next few weeks to stay up-to-date with the latest security patches.

          Thanks

          Andrea

          Andrea Lai added a comment - You are right. It seems something happen in 2.284 that broke our automation. Do we have any workaround or anything that we can do to make it work? We are Okay with 2.283 for awhile but we would need to upgrade in the next few weeks to stay up-to-date with the latest security patches. Thanks Andrea

          The incremental version of the plugin in that PR should resolve the issue https://ci.jenkins.io/blue/organizations/jenkins/Plugins%2Fsshd-plugin/detail/PR-37/8/artifacts, because is not a final release you will have to install it manually and wait for the official release.

          Ivan Fernandez Calvo added a comment - The incremental version of the plugin in that PR should resolve the issue https://ci.jenkins.io/blue/organizations/jenkins/Plugins%2Fsshd-plugin/detail/PR-37/8/artifacts , because is not a final release you will have to install it manually and wait for the official release.

          Jesse Glick added a comment -

          I found that updating the version of SSHD in core to a dev build

          diff --git cli/pom.xml cli/pom.xml
          index af6a574c67..c19b444034 100644
          --- cli/pom.xml
          +++ cli/pom.xml
          @@ -72,7 +72,7 @@
               <dependency>
                 <groupId>org.apache.sshd</groupId>
                 <artifactId>sshd-core</artifactId>
          -      <version>2.6.0</version>
          +      <version>2.7.1-SNAPSHOT</version>
                 <optional>true</optional>
               </dependency>
               <!-- ed25519 algorithm, see JENKINS-45318 -->
          

          corrects the regression as seen in CLITest#strictHostKey with a newer -Djenkins.version=…:

          diff --git src/test/java/org/jenkinsci/main/modules/cli/auth/ssh/CLITest.java src/test/java/org/jenkinsci/main/modules/cli/auth/ssh/CLITest.java
          index 473da96..4041ddf 100644
          --- src/test/java/org/jenkinsci/main/modules/cli/auth/ssh/CLITest.java
          +++ src/test/java/org/jenkinsci/main/modules/cli/auth/ssh/CLITest.java
          @@ -68,6 +68,7 @@ import java.nio.file.Files;
           import java.util.Arrays;
           import java.util.List;
           import java.util.concurrent.TimeUnit;
          +import java.util.logging.Level;
           
           import static org.hamcrest.Matchers.containsString;
           import static org.hamcrest.Matchers.nullValue;
          @@ -77,6 +78,7 @@ import static org.junit.Assert.assertThat;
           import static org.junit.Assume.assumeNoException;
           import static org.junit.Assume.assumeThat;
           import static org.junit.Assume.assumeTrue;
          +import org.jvnet.hudson.test.LoggerRule;
           
           /**
            * Tests CLI operation with the SSH module.
          @@ -90,6 +92,8 @@ public class CLITest {
               @Rule
               public JenkinsRule r = new JenkinsRule();
           
          +    @Rule public LoggerRule logging = new LoggerRule().record("org.jenkinsci.main.modules", Level.ALL).record("org.apache.sshd", Level.ALL);
          +
               @Rule
               public TemporaryFolder tmp = new TemporaryFolder();
           
          

          printed

             5.340 [id=97]	FINEST	o.a.s.s.s.ServerUserAuthService#process: process(ServerSessionImpl[null@/127.0.0.1:40046]) factory authentication=publickey failure details
          java.lang.IllegalArgumentException: No verifier located for algorithm=rsa-sha2-512
          	at org.apache.sshd.common.util.ValidateUtils.createFormattedException(ValidateUtils.java:213)
          	at org.apache.sshd.common.util.ValidateUtils.throwIllegalArgumentException(ValidateUtils.java:179)
          	at org.apache.sshd.common.util.ValidateUtils.checkTrue(ValidateUtils.java:168)
          	at org.apache.sshd.common.util.ValidateUtils.checkNotNull(ValidateUtils.java:40)
          	at org.apache.sshd.server.auth.pubkey.UserAuthPublicKey.doAuth(UserAuthPublicKey.java:94)
          	at org.apache.sshd.server.auth.AbstractUserAuth.auth(AbstractUserAuth.java:70)
          	at org.apache.sshd.server.session.ServerUserAuthService.process(ServerUserAuthService.java:197)
          	at org.apache.sshd.common.session.helpers.AbstractSession.doHandleMessage(AbstractSession.java:614)
          	at org.apache.sshd.common.session.helpers.AbstractSession.handleMessage(AbstractSession.java:547)
          	at org.apache.sshd.common.session.helpers.AbstractSession.decode(AbstractSession.java:1498)
          	at org.apache.sshd.common.session.helpers.AbstractSession.messageReceived(AbstractSession.java:508)
          	at org.apache.sshd.common.session.helpers.AbstractSessionIoHandler.messageReceived(AbstractSessionIoHandler.java:66)
          	at org.apache.sshd.common.io.nio2.Nio2Session.handleReadCycleCompletion(Nio2Session.java:301)
          	at org.apache.sshd.common.io.nio2.Nio2Session$1.onCompleted(Nio2Session.java:281)
          	at org.apache.sshd.common.io.nio2.Nio2Session$1.onCompleted(Nio2Session.java:278)
          	at org.apache.sshd.common.io.nio2.Nio2CompletionHandler.lambda$completed$0(Nio2CompletionHandler.java:38)
          	at java.security.AccessController.doPrivileged(Native Method)
          	at 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)
          

          and some Googling around led me to https://issues.apache.org/jira/browse/SSHD-1105 which is to be fixed in 2.7.0 (tagged a week ago but apparently not yet on Central).

          Jesse Glick added a comment - I found that updating the version of SSHD in core to a dev build diff --git cli/pom.xml cli/pom.xml index af6a574c67..c19b444034 100644 --- cli/pom.xml +++ cli/pom.xml @@ -72,7 +72,7 @@ <dependency> <groupId> org.apache.sshd </groupId> <artifactId> sshd-core </artifactId> - <version> 2.6.0 </version> + <version> 2.7.1-SNAPSHOT </version> <optional> true </optional> </dependency> <!-- ed25519 algorithm, see JENKINS-45318 --> corrects the regression as seen in CLITest#strictHostKey with a newer -Djenkins.version=… : diff --git src/test/java/org/jenkinsci/main/modules/cli/auth/ssh/CLITest.java src/test/java/org/jenkinsci/main/modules/cli/auth/ssh/CLITest.java index 473da96..4041ddf 100644 --- src/test/java/org/jenkinsci/main/modules/cli/auth/ssh/CLITest.java +++ src/test/java/org/jenkinsci/main/modules/cli/auth/ssh/CLITest.java @@ -68,6 +68,7 @@ import java.nio.file.Files; import java.util.Arrays; import java.util.List; import java.util.concurrent.TimeUnit; + import java.util.logging.Level; import static org.hamcrest.Matchers.containsString; import static org.hamcrest.Matchers.nullValue; @@ -77,6 +78,7 @@ import static org.junit.Assert.assertThat; import static org.junit.Assume.assumeNoException; import static org.junit.Assume.assumeThat; import static org.junit.Assume.assumeTrue; + import org.jvnet.hudson.test.LoggerRule; /** * Tests CLI operation with the SSH module. @@ -90,6 +92,8 @@ public class CLITest { @Rule public JenkinsRule r = new JenkinsRule(); + @Rule public LoggerRule logging = new LoggerRule().record( "org.jenkinsci.main.modules" , Level.ALL).record( "org.apache.sshd" , Level.ALL); + @Rule public TemporaryFolder tmp = new TemporaryFolder(); printed 5.340 [id=97] FINEST o.a.s.s.s.ServerUserAuthService#process: process(ServerSessionImpl[null@/127.0.0.1:40046]) factory authentication=publickey failure details java.lang.IllegalArgumentException: No verifier located for algorithm=rsa-sha2-512 at org.apache.sshd.common.util.ValidateUtils.createFormattedException(ValidateUtils.java:213) at org.apache.sshd.common.util.ValidateUtils.throwIllegalArgumentException(ValidateUtils.java:179) at org.apache.sshd.common.util.ValidateUtils.checkTrue(ValidateUtils.java:168) at org.apache.sshd.common.util.ValidateUtils.checkNotNull(ValidateUtils.java:40) at org.apache.sshd.server.auth.pubkey.UserAuthPublicKey.doAuth(UserAuthPublicKey.java:94) at org.apache.sshd.server.auth.AbstractUserAuth.auth(AbstractUserAuth.java:70) at org.apache.sshd.server.session.ServerUserAuthService.process(ServerUserAuthService.java:197) at org.apache.sshd.common.session.helpers.AbstractSession.doHandleMessage(AbstractSession.java:614) at org.apache.sshd.common.session.helpers.AbstractSession.handleMessage(AbstractSession.java:547) at org.apache.sshd.common.session.helpers.AbstractSession.decode(AbstractSession.java:1498) at org.apache.sshd.common.session.helpers.AbstractSession.messageReceived(AbstractSession.java:508) at org.apache.sshd.common.session.helpers.AbstractSessionIoHandler.messageReceived(AbstractSessionIoHandler.java:66) at org.apache.sshd.common.io.nio2.Nio2Session.handleReadCycleCompletion(Nio2Session.java:301) at org.apache.sshd.common.io.nio2.Nio2Session$1.onCompleted(Nio2Session.java:281) at org.apache.sshd.common.io.nio2.Nio2Session$1.onCompleted(Nio2Session.java:278) at org.apache.sshd.common.io.nio2.Nio2CompletionHandler.lambda$completed$0(Nio2CompletionHandler.java:38) at java.security.AccessController.doPrivileged(Native Method) at 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) and some Googling around led me to https://issues.apache.org/jira/browse/SSHD-1105 which is to be fixed in 2.7.0 (tagged a week ago but apparently not yet on Central).

          Jesse Glick added a comment -

          If true, based on the Jira description, the likely workaround is to switch to a different key format.

          Jesse Glick added a comment - If true, based on the Jira description, the likely workaround is to switch to a different key format.

          Tim Jacomb added a comment -

          Can anyone see anything wrong I'm doing here?

          This is on 2.289.1 (also tried a few other versions including 2.283 same result)

          Running on Mac Big Sur, can create another issue if you think it's unrelated

          ➜  azure-test-env git:(master) ✗ java -jar jenkins-cli.jar -s http://localhost:6322/jenkins/  -ssh -user me@timja2.onmicrosoft.com -i /Users/timja/.ssh/id_rsa
          Jun 15, 2021 8:58:06 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
          Jun 15, 2021 8:58:06 PM io.jenkins.cli.shaded.org.apache.sshd.common.io.DefaultIoServiceFactoryFactory getIoServiceProvider
          INFO: No detected/configured IoServiceFactoryFactory using Nio2ServiceFactoryFactory
          Jun 15, 2021 8:58:06 PM 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
          Jun 15, 2021 8:58:06 PM io.jenkins.cli.shaded.org.apache.sshd.client.keyverifier.KnownHostsServerKeyVerifier acceptModifiedServerKey
          WARNING: acceptModifiedServerKey(ClientSessionImpl[me@timja2.onmicrosoft.com@localhost/127.0.0.1:2222]) mismatched keys presented by localhost/127.0.0.1:2222 for entry=[localhost]:2222 ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBCJvLTG+SYW6qBizYLlkT+SzFpMzqtrF6cy3Wj58E42xJJZcqmf7A1sChee37tMNFdcy68dcIuCP08Y33E2V9es=: expected=ecdsa-sha2-nistp256-SHA256:osZ9YtmDwlrUAXBmE6mVA1gWhrvu9161zccYcDk3tME, actual=ssh-rsa-SHA256:DaHXS237KOgo4lOBUofD3cjZWZ279TGSg6ymOdWnDC0
          Jun 15, 2021 8:58:06 PM io.jenkins.cli.shaded.org.apache.sshd.common.session.helpers.SessionHelper disconnect
          INFO: Disconnecting(ClientSessionImpl[me@timja2.onmicrosoft.com@localhost/127.0.0.1:2222]): SSH2_DISCONNECT_HOST_KEY_NOT_VERIFIABLE - Server key did not validate
          io.jenkins.cli.shaded.org.apache.sshd.common.SshException: Server key did not validate
          	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: Server key did not validate
          	at io.jenkins.cli.shaded.org.apache.sshd.client.session.AbstractClientSession.checkKeys(AbstractClientSession.java:583)
          	at io.jenkins.cli.shaded.org.apache.sshd.common.session.helpers.AbstractSession.handleKexMessage(AbstractSession.java:611)
          	at io.jenkins.cli.shaded.org.apache.sshd.common.session.helpers.AbstractSession.doHandleMessage(AbstractSession.java:500)
          	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.base/java.security.AccessController.doPrivileged(Native Method)
          	at io.jenkins.cli.shaded.org.apache.sshd.common.io.nio2.Nio2CompletionHandler.completed(Nio2CompletionHandler.java:37)
          	at java.base/sun.nio.ch.Invoker.invokeUnchecked(Invoker.java:127)
          	at java.base/sun.nio.ch.Invoker$2.run(Invoker.java:219)
          	at java.base/sun.nio.ch.AsynchronousChannelGroupImpl$1.run(AsynchronousChannelGroupImpl.java:112)
          	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
          	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
          	at java.base/java.lang.Thread.run(Thread.java:834)
          

          ssh itself works fine:

          ➜  azure-test-env git:(master) ✗ ssh me@timja2.onmicrosoft.com@127.0.0.1 -p 2222 list-jobs
          freestyle
          no-restrictions
          

          I'm trying to reproduce https://github.com/jenkinsci/azure-ad-plugin/issues/128 but I can't get the CLI to work at all =/

          Tim Jacomb added a comment - Can anyone see anything wrong I'm doing here? This is on 2.289.1 (also tried a few other versions including 2.283 same result) Running on Mac Big Sur, can create another issue if you think it's unrelated ➜ azure-test-env git:(master) ✗ java -jar jenkins-cli.jar -s http: //localhost:6322/jenkins/ -ssh -user me@timja2.onmicrosoft.com -i /Users/timja/.ssh/id_rsa Jun 15, 2021 8:58:06 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 Jun 15, 2021 8:58:06 PM io.jenkins.cli.shaded.org.apache.sshd.common.io.DefaultIoServiceFactoryFactory getIoServiceProvider INFO: No detected/configured IoServiceFactoryFactory using Nio2ServiceFactoryFactory Jun 15, 2021 8:58:06 PM 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 Jun 15, 2021 8:58:06 PM io.jenkins.cli.shaded.org.apache.sshd.client.keyverifier.KnownHostsServerKeyVerifier acceptModifiedServerKey WARNING: acceptModifiedServerKey(ClientSessionImpl[me@timja2.onmicrosoft.com@localhost/127.0.0.1:2222]) mismatched keys presented by localhost/127.0.0.1:2222 for entry=[localhost]:2222 ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBCJvLTG+SYW6qBizYLlkT+SzFpMzqtrF6cy3Wj58E42xJJZcqmf7A1sChee37tMNFdcy68dcIuCP08Y33E2V9es=: expected=ecdsa-sha2-nistp256-SHA256:osZ9YtmDwlrUAXBmE6mVA1gWhrvu9161zccYcDk3tME, actual=ssh-rsa-SHA256:DaHXS237KOgo4lOBUofD3cjZWZ279TGSg6ymOdWnDC0 Jun 15, 2021 8:58:06 PM io.jenkins.cli.shaded.org.apache.sshd.common.session.helpers.SessionHelper disconnect INFO: Disconnecting(ClientSessionImpl[me@timja2.onmicrosoft.com@localhost/127.0.0.1:2222]): SSH2_DISCONNECT_HOST_KEY_NOT_VERIFIABLE - Server key did not validate io.jenkins.cli.shaded.org.apache.sshd.common.SshException: Server key did not validate 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: Server key did not validate at io.jenkins.cli.shaded.org.apache.sshd.client.session.AbstractClientSession.checkKeys(AbstractClientSession.java:583) at io.jenkins.cli.shaded.org.apache.sshd.common.session.helpers.AbstractSession.handleKexMessage(AbstractSession.java:611) at io.jenkins.cli.shaded.org.apache.sshd.common.session.helpers.AbstractSession.doHandleMessage(AbstractSession.java:500) 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.base/java.security.AccessController.doPrivileged(Native Method) at io.jenkins.cli.shaded.org.apache.sshd.common.io.nio2.Nio2CompletionHandler.completed(Nio2CompletionHandler.java:37) at java.base/sun.nio.ch.Invoker.invokeUnchecked(Invoker.java:127) at java.base/sun.nio.ch.Invoker$2.run(Invoker.java:219) at java.base/sun.nio.ch.AsynchronousChannelGroupImpl$1.run(AsynchronousChannelGroupImpl.java:112) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang. Thread .run( Thread .java:834) ssh itself works fine: ➜ azure-test-env git:(master) ✗ ssh me@timja2.onmicrosoft.com@127.0.0.1 -p 2222 list-jobs freestyle no-restrictions I'm trying to reproduce https://github.com/jenkinsci/azure-ad-plugin/issues/128 but I can't get the CLI to work at all =/

          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.

          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.

          Tim Jacomb added a comment -

          Isn’t that what I did?

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

          Tim Jacomb added a comment -

          Oh local host will check soon

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

          Tim Jacomb added a comment -

          teilo

          ➜  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
          

          Tim Jacomb added a comment - teilo ➜ 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

          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
          

          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

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

              Created:
              Updated:
              Resolved: