0

我们正在使用 Ganymed-SSH 库并在对另一台机器执行 SSH 时遇到此错误。

[root@XXXX test]# java -classpath .:ganymed-ssh2-build210.jar Basic 

ERROR:java.io.IOException: There was a problem while connecting to 10.X.X.X:22
java.io.IOException: There was a problem while connecting to 10.X.X.X:22
    at ch.ethz.ssh2.Connection.connect(Connection.java:699)
    at ch.ethz.ssh2.Connection.connect(Connection.java:490)
    at Basic.main(Basic.java:27)
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)
    ... 2 more
Caused by: java.io.IOException: Cannot read full block, EOF reached.
    at ch.ethz.ssh2.crypto.cipher.CipherInputStream.getBlock(CipherInputStream.java:81)
    at ch.ethz.ssh2.crypto.cipher.CipherInputStream.read(CipherInputStream.java:108)
    at ch.ethz.ssh2.transport.TransportConnection.receiveMessage(TransportConnection.java:231)
    at ch.ethz.ssh2.transport.TransportManager.receiveLoop(TransportManager.java:669)
    at ch.ethz.ssh2.transport.TransportManager$1.run(TransportManager.java:468)
    at java.lang.Thread.run(Thread.java:636)

谁能解释这里可能是什么问题?我们应该从哪里开始调试?来自普通 shell 的 SSH 访问正常工作。

4

2 回答 2

0

可能你的公钥有问题

于 2012-12-14T11:54:00.167 回答
0

在 solaris 10 上的 141742-01/02 补丁后 ssh 失败!

在 ssh/sshd 中启用的 aes192/aes256 支持在 S10u3 或更早版本上不起作用

一种解决方法是禁用 ssh 和 sshd 的 aes192/aes256 密码。更改两个配置文件 /etc/ssh/ssh_config 和 /etc/ssh/sshd_config 并添加以下行:

密码 aes128-ctr、aes128-cbc、arcfour、3des-cbc、blowfish-cbc

您必须重新启动 sshd 以获取更改(“svcadm restart ssh”)。

资料来源: http ://blog.mydream.com.hk/howto/matching-cipher-is-not-supported-aes256-cbc

于 2013-02-06T05:44:57.953 回答