java.io.IOException: There was a problem while connecting to ip:端口2
at ch.ethz.ssh2.Connection.connect(Connection.java:699)
at ch.ethz.ssh2.Connection.connect(Connection.java:490)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
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)
... 13 more
Caused by: java.io.IOException: Cannot negotiate, propo
ganymed组件ssh连接openssh高版本报错
于 2023-03-07 18:05:24 首次发布
文章讲述了在Java使用SSH2库连接到OpenSSH服务器时遇到的IOException,由于OpenSSH版本较高,默认禁用了不安全的Diffie-Hellman算法。为了解决这个问题,建议在服务器的sshd_config中添加支持旧算法的配置项,并重启sshd服务,作为临时解决方案。

最低0.47元/天 解锁文章
4195





