Skip to content

[JENKINS-33021] trilead ssh MAC and key exchange algorithms severely outdated #798

Description

@jenkins-infra-bot

The supported macs and kex methods in trilead are severely outdated, resulting in connection issues with properly secured ssh daemons on target machines. For instance:

sshd[9800]: fatal: no matching mac found: client hmac-sha1-96,hmac-sha1,hmac-md5-96,hmac-md5 server hmac-sha2-256,hmac-sha2-512,umac-64@​openssh.com,hmac-ripemd160 [preauth]

In JENKINS-14709 a suggestion is made to replace trilead with orion, but Orion is not being maintained either. Orion refers to Ganymed, but even that hasn't been looked at for almost 2 years: Ganymed commits. It does seem to support hmac-sha2 macs though.

From JENKINS-36873">JENKINS-36873 (dupe)

The ssh credentials plugin is unable to connect to slaves that have newer algorithms

The keys from Jenkins (client) and slave (server below) have:

fatal: no matching mac found:
client: hmac-sha1-96,hmac-sha1,hmac-md5-96,hmac-md5
server: hmac-sha2-512-etm@​openssh.com,hmac-sha2-256-etm@​openssh.com,umac-128-etm@​openssh.com,hmac-sha2-512,hmac-sha2-256,umac-128@​openssh.com [preauth]

Jenkins yields a trace:

[06/22/15 14:49:05] [SSH] Opening SSH connection to 10.68.16.150:22.
Key exchange was not finished, connection is closed.
ERROR: Unexpected error in launching a slave. This is probably a bug in Jenkins.
java.lang.IllegalStateException: Connection is not established!
	at com.trilead.ssh2.Connection.getRemainingAuthMethods(Connection.java:1030)
	at com.cloudbees.jenkins.plugins.sshcredentials.impl.TrileadSSHPublicKeyAuthenticator.getRemainingAuthMethods(TrileadSSHPublicKeyAuthenticator.java:88)
	at com.cloudbees.jenkins.plugins.sshcredentials.impl.TrileadSSHPublicKeyAuthenticator.canAuthenticate(TrileadSSHPublicKeyAuthenticator.java:80)
	at com.cloudbees.jenkins.plugins.sshcredentials.SSHAuthenticator.newInstance(SSHAuthenticator.java:207)
	at com.cloudbees.jenkins.plugins.sshcredentials.SSHAuthenticator.newInstance(SSHAuthenticator.java:169)
	at hudson.plugins.sshslaves.SSHLauncher.openConnection(SSHLauncher.java:1173)
	at hudson.plugins.sshslaves.SSHLauncher$2.call(SSHLauncher.java:701)
	at hudson.plugins.sshslaves.SSHLauncher$2.call(SSHLauncher.java:696)
	at java.util.concurrent.FutureTask.run(FutureTask.java:262)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
	at java.lang.Thread.run(Thread.java:745)
[06/22/15 14:49:06] Launch failed - cleaning up connection
[06/22/15 14:49:06] [SSH] Connection closed.

On our slaves we would like to have hmac-sha2-512 / hmac-sha2-256 but that is not supported by Trilead SSH.


Originally reported by emma, imported from: trilead ssh MAC and key exchange algorithms severely outdated
  • assignee: mc1arke
  • status: Resolved
  • priority: Critical
  • component(s): ssh-slaves-plugin
  • resolution: Fixed
  • resolved: 2017-05-01T20:05:54+00:00
  • votes: 13
  • watchers: 18
  • imported: 20251212-090250
Raw content of original issue

The supported macs and kex methods in trilead are severely outdated, resulting in connection issues with properly secured ssh daemons on target machines. For instance:

sshd[9800]: fatal: no matching mac found: client hmac-sha1-96,hmac-sha1,hmac-md5-96,hmac-md5 server hmac-sha2-256,hmac-sha2-512,umac-64@openssh.com,hmac-ripemd160 [preauth]

In JENKINS-14709 a suggestion is made to replace trilead with orion, but Orion is not being maintained either. Orion refers to Ganymed, but even that hasn't been looked at for almost 2 years: Ganymed commits. It does seem to support hmac-sha2 macs though.

From JENKINS-36873 (dupe)

The ssh credentials plugin is unable to connect to slaves that have newer algorithms

The keys from Jenkins (client) and slave (server below) have:

fatal: no matching mac found:
client: hmac-sha1-96,hmac-sha1,hmac-md5-96,hmac-md5
server: hmac-sha2-512-etm@openssh.com,hmac-sha2-256-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-512,hmac-sha2-256,umac-128@openssh.com [preauth]

Jenkins yields a trace:

[06/22/15 14:49:05] [SSH] Opening SSH connection to 10.68.16.150:22.
Key exchange was not finished, connection is closed.
ERROR: Unexpected error in launching a slave. This is probably a bug in Jenkins.
java.lang.IllegalStateException: Connection is not established!
	at com.trilead.ssh2.Connection.getRemainingAuthMethods(Connection.java:1030)
	at com.cloudbees.jenkins.plugins.sshcredentials.impl.TrileadSSHPublicKeyAuthenticator.getRemainingAuthMethods(TrileadSSHPublicKeyAuthenticator.java:88)
	at com.cloudbees.jenkins.plugins.sshcredentials.impl.TrileadSSHPublicKeyAuthenticator.canAuthenticate(TrileadSSHPublicKeyAuthenticator.java:80)
	at com.cloudbees.jenkins.plugins.sshcredentials.SSHAuthenticator.newInstance(SSHAuthenticator.java:207)
	at com.cloudbees.jenkins.plugins.sshcredentials.SSHAuthenticator.newInstance(SSHAuthenticator.java:169)
	at hudson.plugins.sshslaves.SSHLauncher.openConnection(SSHLauncher.java:1173)
	at hudson.plugins.sshslaves.SSHLauncher$2.call(SSHLauncher.java:701)
	at hudson.plugins.sshslaves.SSHLauncher$2.call(SSHLauncher.java:696)
	at java.util.concurrent.FutureTask.run(FutureTask.java:262)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
	at java.lang.Thread.run(Thread.java:745)
[06/22/15 14:49:06] Launch failed - cleaning up connection
[06/22/15 14:49:06] [SSH] Connection closed.

On our slaves we would like to have hmac-sha2-512 / hmac-sha2-256 but that is not supported by Trilead SSH.

  • environment: Jenkins 1.647, ssh-slaves-plugin 1.10

Activity

  1. jenkins-infra-bot commented on Feb 18, 2016

    @jenkins-infra-bot
    Author
  2. jenkins-infra-bot commented on Mar 4, 2016

    @jenkins-infra-bot
    Author
    ollirajala:
    • Original comment link
    • Raw content of original comment:

      This is a critical issue for us, because our security policy dictates that we must have quite strict ssh cipher settings configured to all our ssh servers.

    This is a critical issue for us, because our security policy dictates that we must have quite strict ssh cipher settings configured to all our ssh servers.

  3. jenkins-infra-bot commented on Apr 11, 2016

    @jenkins-infra-bot
    Author
    oleg_nenashev:
    • Original comment link
    • Raw content of original comment:

      I see the same issue when I connect the clean Ubuntu Server 14.04.4 LTS with the latest openssh-server from the update center

    I see the same issue when I connect the clean Ubuntu Server 14.04.4 LTS with the latest openssh-server from the update center

  4. jenkins-infra-bot commented on Apr 12, 2016

    @jenkins-infra-bot
    Author
    oleg_nenashev:
    • Original comment link
    • Raw content of original comment:

      In my case I had to weaken the security settings and to use the common RSA algorithm

    In my case I had to weaken the security settings and to use the common RSA algorithm

  5. jenkins-infra-bot commented on Jul 6, 2016

    @jenkins-infra-bot
    Author
    biogerm:

    I used another fork of Trilead ssh2 instead which has sha256 implemented.

    it's called ConnectBot sshlib. available on GitHub. https://github.com/connectbot/sshlib

  6. jenkins-infra-bot commented on Jul 22, 2016

    @jenkins-infra-bot
    Author
    hashar:
    • Original comment link
    • Raw content of original comment:

      I have added a trace / some details from the duplicate task I have filled JENKINS-36873. As I understand it that Java installation is stall/no more updated by upstream and Jenkins core provides its own fork. Looks like the proper way to fix it would be to remove Trilead entirely and switch to another SSH implementation. Maybe Bouncy Castle?

      The workaround is to configure the slaves with some outdated algorithms supported by Trilead

      Our bug for my own reference https://phabricator.wikimedia.org/T103351

    I have added a trace / some details from the duplicate task I have filled JENKINS-36873">JENKINS-36873. As I understand it that Java installation is stall/no more updated by upstream and Jenkins core provides its own fork. Looks like the proper way to fix it would be to remove Trilead entirely and switch to another SSH implementation. Maybe Bouncy Castle?

    The workaround is to configure the slaves with some outdated algorithms supported by Trilead

    Our bug for my own reference https://phabricator.wikimedia.org/T103351

  7. jenkins-infra-bot commented on Jul 22, 2016

    @jenkins-infra-bot
    Author
    emma:
    • Original comment link
    • Raw content of original comment:

      Couldn't find a similar issue when I created this one, but apparently it did exist.

    Couldn't find a similar issue when I created this one, but apparently it did exist.

  8. jenkins-infra-bot commented on Aug 25, 2016

    @jenkins-infra-bot
    Author
    jjmartinez:
    • Original comment link
    • Raw content of original comment:

      Having this same issue in Jenkins 2.x and SSH plugin 1.11.

      Our problem is the key exchange when checking out SVN repos.

    Having this same issue in Jenkins 2.x and SSH plugin 1.11.

    Our problem is the key exchange when checking out SVN repos.

  9. jenkins-infra-bot commented on Sep 27, 2016

    @jenkins-infra-bot
    Author
    ygirouard:
    • Original comment link
    • Raw content of original comment:

      Has anyone found a working solution to this issue that doesn't involve changing accepted ciphers on the slaves?

    Has anyone found a working solution to this issue that doesn't involve changing accepted ciphers on the slaves?

  10. jenkins-infra-bot commented on Sep 27, 2016

    @jenkins-infra-bot
    Author
    oleg_nenashev:
    • Original comment link
    • Raw content of original comment:

      From what I see "no". Kohsuke was just a default assignee, but he rarely works on plugins now. Removed the assignee

    From what I see "no". Kohsuke was just a default assignee, but he rarely works on plugins now. Removed the assignee

  11. jenkins-infra-bot commented on Apr 5, 2017

    @jenkins-infra-bot
    Author
    hashar:

    A few various pull requests have been sent. Seems the active one is now jenkinsci/trilead-ssh2#14 proposed by Michael Clarke (assignee of this task).

  12. jenkins-infra-bot commented on Apr 10, 2017

    @jenkins-infra-bot
    Author
    scm_issue_link:
    • Original comment link
    • Raw content of original comment:

      Code changed in jenkins User: Michael Clarke Path: src/com/trilead/ssh2/Connection.java src/com/trilead/ssh2/KnownHosts.java src/com/trilead/ssh2/crypto/CryptoWishList.java src/com/trilead/ssh2/crypto/dh/DhExchange.java src/com/trilead/ssh2/crypto/dh/DhGroupExchange.java src/com/trilead/ssh2/crypto/digest/HMAC.java src/com/trilead/ssh2/crypto/digest/HashForSSH2Types.java src/com/trilead/ssh2/crypto/digest/JreMessageDigestWrapper.java src/com/trilead/ssh2/crypto/digest/MAC.java src/com/trilead/ssh2/crypto/digest/MD5.java src/com/trilead/ssh2/crypto/digest/MessageMac.java src/com/trilead/ssh2/crypto/digest/SHA1.java src/com/trilead/ssh2/transport/KexManager.java src/com/trilead/ssh2/transport/KexState.java http://jenkins-ci.org/commit/trilead-ssh2/3aaec8394cb949499061186219ab9c513c0d9eea Log: Merge pull request #14 from jenkinsci/SHA256-and-SHA512-HMAC-support

      JENKINS-33021 Add support for SHA256 and SHA512 HMAC algorithms

      Compare: jenkinsci/trilead-ssh2@d0178c2...3aaec83

    Code changed in jenkins
    User: Michael Clarke
    Path:
    src/com/trilead/ssh2/Connection.java
    src/com/trilead/ssh2/KnownHosts.java
    src/com/trilead/ssh2/crypto/CryptoWishList.java
    src/com/trilead/ssh2/crypto/dh/DhExchange.java
    src/com/trilead/ssh2/crypto/dh/DhGroupExchange.java
    src/com/trilead/ssh2/crypto/digest/HMAC.java
    src/com/trilead/ssh2/crypto/digest/HashForSSH2Types.java
    src/com/trilead/ssh2/crypto/digest/JreMessageDigestWrapper.java
    src/com/trilead/ssh2/crypto/digest/MAC.java
    src/com/trilead/ssh2/crypto/digest/MD5.java
    src/com/trilead/ssh2/crypto/digest/MessageMac.java
    src/com/trilead/ssh2/crypto/digest/SHA1.java
    src/com/trilead/ssh2/transport/KexManager.java
    src/com/trilead/ssh2/transport/KexState.java
    http://jenkins-ci.org/commit/trilead-ssh2/3aaec8394cb949499061186219ab9c513c0d9eea
    Log:
    Merge pull request #14 from jenkinsci/SHA256-and-SHA512-HMAC-support

    JENKINS-33021">JENKINS-33021 Add support for SHA256 and SHA512 HMAC algorithms

    Compare: jenkinsci/trilead-ssh2@d0178c2...3aaec83

  13. jenkins-infra-bot commented on Apr 13, 2017

    @jenkins-infra-bot
    Author
    paladox:
    • Original comment link
    • Raw content of original comment:

      Resolving the issue as a new trilead-ssh2 release has been done with ^^ change. All that needs doing is jenkins to be updated now.

    Resolving the issue as a new trilead-ssh2 release has been done with ^^ change. All that needs doing is jenkins to be updated now.

  14. jenkins-infra-bot commented on Apr 14, 2017

    @jenkins-infra-bot
    Author
    paladox:
    • Original comment link
    • Raw content of original comment:

      Re opening as still in progress.

    Re opening as still in progress.

  15. jenkins-infra-bot commented on Apr 18, 2017

    @jenkins-infra-bot
    Author
    markl_lagendijk:

    You can follow progress here:

    https://issues.jenkins-ci.org/browse/JENKINS-43610

  16. 4 remaining items

  17. jenkins-infra-bot commented on Oct 11, 2017

    @jenkins-infra-bot
    Author
    hashar:
    • Original comment link
    • Raw content of original comment:

      Thank you Michael Clarke ! That works perfectly and we use:

       

      server: hmac-sha2-512-etm@openssh.com,hmac-sha2-256-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-512,hmac-sha2-256,umac-128@openssh.com [preauth]
      

    Thank you Michael Clarke ! That works perfectly and we use:

     

    server: hmac-sha2-512-etm@​openssh.com,hmac-sha2-256-etm@​openssh.com,umac-128-etm@​openssh.com,hmac-sha2-512,hmac-sha2-256,umac-128@​openssh.com [preauth]
    
    
  18. jenkins-infra-bot commented on Dec 12, 2025

    @jenkins-infra-bot
    Author

    [Original duplicates from Jira: JENKINS-31549]

  19. jenkins-infra-bot commented on Dec 12, 2025

    @jenkins-infra-bot
    Author

    [Original is_duplicated_by from Jira: JENKINS-36873]

  20. jenkins-infra-bot commented on Dec 12, 2025

    @jenkins-infra-bot
    Author

    [Original relates_to from Jira: JENKINS-26379]

  21. jenkins-infra-bot commented on Dec 12, 2025

    @jenkins-infra-bot
    Author

    [Original relates_to from Jira: JENKINS-26495]

  22. jenkins-infra-bot commented on Dec 12, 2025

    @jenkins-infra-bot
    Author

    [Original relates_to from Jira: JENKINS-39805]

  23. jenkins-infra-bot commented on Dec 12, 2025

    @jenkins-infra-bot
    Author

    [Original relates_to from Jira: JENKINS-44046]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions