com.jcraft.jsch.JSchException: Algorithm negotiation fail* *at com.jcraft.jsch.Session.receive_kexinit(Session.java:520)*

Jenkins JIRA | theo . | 2 years ago
  1. 0

    Hello, Today I faced an issue involving SSH with my Jenkins, the error is as follow: [SSH] Exception:Algorithm negotiation fail *com.jcraft.jsch.JSchException: Algorithm negotiation fail* *at com.jcraft.jsch.Session.receive_kexinit(Session.java:520)* at com.jcraft.jsch.Session.connect(Session.java:286) at com.jcraft.jsch.Session.connect(Session.java:150) at org.jvnet.hudson.plugins.SSHSite.createSession(SSHSite.java:141) at org.jvnet.hudson.plugins.SSHSite.executeCommand(SSHSite.java:151) at org.jvnet.hudson.plugins.SSHBuilder.perform(SSHBuilder.java:60) at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20) at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:770) at hudson.model.Build$BuildExecution.build(Build.java:199) at hudson.model.Build$BuildExecution.doRun(Build.java:160) at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:533) at hudson.model.Run.execute(Run.java:1759) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) at hudson.model.ResourceController.execute(ResourceController.java:89) at hudson.model.Executor.run(Executor.java:240) This error happened because my OpenSSH version just upgraded from 6.6 to 6.7 (as most debian jessie users), in the [OpenSSH changelog|http://www.openssh.com/txt/release-6.7] you can clearly see "The default set of ciphers and MACs has been altered to remove unsafe algorithms". OpenSSH 6.7 default key exchange algorithms: * curve25519-sha256@libssh.org * ecdh-sha2-nistp256 * ecdh-sha2-nistp384 * ecdh-sha2-nistp521 * diffie-hellman-group-exchange-sha256 * diffie-hellman-group14-sha1 Unfortunately ssh-credentials rely on JSch which use *diffie-hellman-group-exchange-sha1* and *diffie-hellman-group1-sha1* for key exchange, and those algorithms are no longer part of OpenSSH default key exchange algos. Since version 0.1.49 JSch support *diffie-hellman-group-exchange-sha256*. I would suggest to update ssh-credentials dependency to rely on JSch 0.1.49, so everybody feel up to date and secure.

    Jenkins JIRA | 2 years ago | theo .
    com.jcraft.jsch.JSchException: Algorithm negotiation fail* *at com.jcraft.jsch.Session.receive_kexinit(Session.java:520)*
  2. 0

    Hello, Today I faced an issue involving SSH with my Jenkins, the error is as follow: [SSH] Exception:Algorithm negotiation fail *com.jcraft.jsch.JSchException: Algorithm negotiation fail* *at com.jcraft.jsch.Session.receive_kexinit(Session.java:520)* at com.jcraft.jsch.Session.connect(Session.java:286) at com.jcraft.jsch.Session.connect(Session.java:150) at org.jvnet.hudson.plugins.SSHSite.createSession(SSHSite.java:141) at org.jvnet.hudson.plugins.SSHSite.executeCommand(SSHSite.java:151) at org.jvnet.hudson.plugins.SSHBuilder.perform(SSHBuilder.java:60) at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20) at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:770) at hudson.model.Build$BuildExecution.build(Build.java:199) at hudson.model.Build$BuildExecution.doRun(Build.java:160) at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:533) at hudson.model.Run.execute(Run.java:1759) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) at hudson.model.ResourceController.execute(ResourceController.java:89) at hudson.model.Executor.run(Executor.java:240) This error happened because my OpenSSH version just upgraded from 6.6 to 6.7 (as most debian jessie users), in the [OpenSSH changelog|http://www.openssh.com/txt/release-6.7] you can clearly see "The default set of ciphers and MACs has been altered to remove unsafe algorithms". OpenSSH 6.7 default key exchange algorithms: * curve25519-sha256@libssh.org * ecdh-sha2-nistp256 * ecdh-sha2-nistp384 * ecdh-sha2-nistp521 * diffie-hellman-group-exchange-sha256 * diffie-hellman-group14-sha1 Unfortunately ssh-credentials rely on JSch which use *diffie-hellman-group-exchange-sha1* and *diffie-hellman-group1-sha1* for key exchange, and those algorithms are no longer part of OpenSSH default key exchange algos. Since version 0.1.49 JSch support *diffie-hellman-group-exchange-sha256*. I would suggest to update ssh-credentials dependency to rely on JSch 0.1.49, so everybody feel up to date and secure.

    Jenkins JIRA | 2 years ago | theo .
    com.jcraft.jsch.JSchException: Algorithm negotiation fail* *at com.jcraft.jsch.Session.receive_kexinit(Session.java:520)*
  3. 0

    Jenkins SSH Plugin / SSH Agent plugin: Exception:timeout: socket is not established

    Stack Overflow | 1 year ago | Arun Sangal
    com.jcraft.jsch.JSchException: timeout: socket is not established
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Algorithm negotiation fail in Jenkins

    Stack Overflow | 1 year ago | Ehsan Enayati
    com.jcraft.jsch.JSchException: Algorithm negotiation fail
  6. 0

    Jenkins issues - [JIRA] [ssh] (JENKINS-17440) SSH Plugin throws auth cancel

    nabble.com | 11 months ago
    com.jcraft.jsch.JSchException: Auth cancel

  1. abrazeneb 1 times, last 3 months ago
96 unregistered visitors
Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. com.jcraft.jsch.JSchException

    Algorithm negotiation fail* *at com.jcraft.jsch.Session.receive_kexinit(Session.java:520)*

    at com.jcraft.jsch.Session.connect()
  2. JSch
    Session.connect
    1. com.jcraft.jsch.Session.connect(Session.java:286)
    2. com.jcraft.jsch.Session.connect(Session.java:150)
    2 frames
  3. org.jvnet.hudson
    SSHBuilder.perform
    1. org.jvnet.hudson.plugins.SSHSite.createSession(SSHSite.java:141)
    2. org.jvnet.hudson.plugins.SSHSite.executeCommand(SSHSite.java:151)
    3. org.jvnet.hudson.plugins.SSHBuilder.perform(SSHBuilder.java:60)
    3 frames
  4. Hudson
    Executor.run
    1. hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
    2. hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:770)
    3. hudson.model.Build$BuildExecution.build(Build.java:199)
    4. hudson.model.Build$BuildExecution.doRun(Build.java:160)
    5. hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:533)
    6. hudson.model.Run.execute(Run.java:1759)
    7. hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
    8. hudson.model.ResourceController.execute(ResourceController.java:89)
    9. hudson.model.Executor.run(Executor.java:240)
    9 frames