Key exchange was not finished, connection is closed Cannot negotiate, proposals do not match

ubuntu系统报错

Caused by: java.io.IOException: Key exchange was not finished, connection is closed.
    at ch.ethz.ssh2.transport.KexManager.getOrWaitForConnectionInfo(KexManager.java:91)
    at ch.ethz.ssh2.transport.TransportManager.getConnectionInfo(TransportManager.java:229)
    at ch.ethz.ssh2.Connection.connect(Connection.java:655)
    ... 12 more
Caused by: java.io.IOException: Cannot negotiate, proposals do not match.
    at ch.ethz.ssh2.transport.KexManager.handleMessage(KexManager.java:412)
    at ch.ethz.ssh2.transport.TransportManager.receiveLoop(TransportManager.java:753)
    at ch.ethz.ssh2.transport.TransportManager$1.run(TransportManager.java:468)
    at java.base/java.lang.Thread.run(Thread.java:840)

解决办法:

vim /etc/ssh/sshd_config

KexAlgorithms diffie-hellman-group1-sha1,diffie-hellman-group14-sha1,diffie-hellman-group-exchange-sha1,diffie-hellman-group-exchange-sha256,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group1-sha1,[email protected]


HostKeyAlgorithms ssh-dss,ssh-rsa

保存后,重启ssh服务 /etc/init.d/ssh restart

你可能感兴趣的:(linux)