Code Robo
Formatter
Comparator
Tester
Merger
Converter
Utility
Java Code Complience
Validator
EncoderDecoder
Virtual Service
com.sshtools.j2ssh.transport.kex.KeyExchangeException: No suitable key exchange algorithm could be agreed.
       Talk to EasyAssistant

Solve 'com.sshtools.j2ssh.transport.kex.KeyExchangeException: No suitable key exchange algorithm could be agreed.' exception with REHL 9 instance in AWS ..

This page tells you how to solve the "com.sshtools.j2ssh.transport.kex.KeyExchangeException: No suitable key exchange algorithm could be agreed." exception when you are trying to connect redhat linux (RHEL) 9 from a java clinet program over SSH using j2ssh library/jar and authenticated by key or password.

If you trying to connect Red Hat Linux (RHEL) centos 9 over SSH using j2ssh library (j2ssh-core-1.1.2.jar) and getting following exception, you can solve it by following change..
"com.sshtools.j2ssh.transport.kex.KeyExchangeException: No suitable key exchange algorithm could be agreed."
Exception:
Exception in thread "main" com.sshtools.j2ssh.transport.kex.KeyExchangeException: No suitable key exchange algorithm could be agreed.
	at com.sshtools.j2ssh.transport.TransportProtocolCommon.beginKeyExchange(Unknown Source)
	at com.sshtools.j2ssh.transport.TransportProtocolCommon.onMsgKexInit(Unknown Source)
	at com.sshtools.j2ssh.transport.TransportProtocolCommon.startBinaryPacketProtocol(Unknown Source)
	at com.sshtools.j2ssh.transport.TransportProtocolCommon.run(Unknown Source)
	at java.base/java.lang.Thread.run(Thread.java:833)

Solution:
Update crypto-policies set DEFAULT:SHA1 crypto policy executing the command : "update-crypto-policies --set DEFAULT:SHA1" .
Reboot the system also as the plicy update is gloabl and it will impact all the application connecting to this box.
Screenshot:
setting up policy



Post Your Comment:
Name :
Email ( Optional) :
Comments / Suggestion (* Required) It is required: :
: