2012-12-14 318 views
0

我们使用Ganymed-SSH库并在执行到另一台机器的SSH时面临此错误。用于java连接的Ganymed SSH问题

[[email protected] 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访问正常工作。

+0

什么是服务器日志说?您可以尝试在服务器上调试调试级别以获取更多信息。 –

+0

:(我没有权限在调试模式下重新启动目标sshd – Sandeep

+0

你也可以在* sshd *守护进程线程上尝试'strace'(尽管你可能有权这么做......) –

回答

0

SSH后141742-01/02在Solaris 10的补丁失败!在SSH/sshd的

启用AES192/AES256支持不能在S10U3工作或旧的发布

一种解决方法是禁用SSH采用AES192/AES256加密的和sshd。改变两个配置文件在/ etc/SSH/ssh_config中和/ etc/SSH/sshd_config文件,并添加以下行:

加密算法AES128-CTR,AES128-CBC,ARCFOUR,3DES-CBC,河豚-CBC

你将不得不重新启动sshd来获取更改(“svcadm restart ssh”)。

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

0

可能有一些问题,你的公钥

+0

公钥目标机器还是源代码? – Sandeep