Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JSchException: Algorithm negotiation fail #87

Closed
jonas-andersen opened this issue Oct 2, 2023 · 3 comments
Closed

JSchException: Algorithm negotiation fail #87

jonas-andersen opened this issue Oct 2, 2023 · 3 comments
Assignees
Milestone

Comments

@jonas-andersen
Copy link
Contributor

When attempting to execute a batch run with type REMOTE, the following error is reported in the console:

com.jcraft.jsch.JSchException: Algorithm negotiation fail
at com.jcraft.jsch.Session.receive_kexinit(Session.java:552) ~[jsch-0.1.48.jar:?]
at com.jcraft.jsch.Session.connect(Session.java:299) ~[jsch-0.1.48.jar:?]
at com.jcraft.jsch.Session.connect(Session.java:162) ~[jsch-0.1.48.jar:?]
at repast.simphony.batch.ssh.SSHSessionFactory.create(SSHSessionFactory.java:75) ~[bin/:?]
at repast.simphony.batch.ssh.RemoteSession.copyFile(RemoteSession.java:141) ~[bin/:?]
at repast.simphony.batch.ssh.RemoteSession.initModelArchive(RemoteSession.java:134) ~[bin/:?]

This is encountered when attempting to connect to a new Debian 12.1 install.

I have attempted adding the Jsch algorithms to the server sshd in /etc/ssh/sshd_config:

KexAlgorithms +diffie-hellman-group1-sha1,diffie-hellman-group14-sha1,diffie-hellman-group-exchange-sha1

but despite being listed in both "kex: server:" and "kex: client:" debug output is still produces the same error.

The included Jsch library is quite old (jsch-0.1.48 is from 2012 according to Maven central). I tried with the latest version (0.1.55 from 2018), which produces the same error.

From a bit of searching, it appears that the original Jsch has been abandoned.

There is a fork, which seems to still be active - https://github.com/mwiede/jsch/releases. This seems to be a drop-in replacement. I tested the latest version jsch-0.2.11 by downloading it and putting it in the Repast eclipse/plugins/repast.simphony.distributed.batch_2.10.0/lib directory (renaming and overwriting the existing jsch-0.1.48.jar to avoid having to update version plugin manifests... for the test). This seemed to work ok.
Whether this fork is suitable as a replacement in general, I cannot say.

Another alternative might be to switch to Apache Mina SSHD. This was mentioned in some Eclipse archives discussing Jsch replacement for egit. Whether that would be a better approach is not something I can comment on at this time.

@ncollier
Copy link
Member

ncollier commented Oct 3, 2023

OK. Thanks! We will look into a jsch replacement.

@ncollier
Copy link
Member

I can reproduce this with bebop as the remote.

@ncollier
Copy link
Member

Updated to newest jsch release: a784aeb

  • Connected successfully to bebop
  • Remote ran successfully between two macs

@etatara etatara added this to the v.2.11.0 milestone Jun 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants