简体   繁体   English

Ganymed SSH for Java连接问题

[英]Ganymed SSH for java connect issue

We are using the Ganymed-SSH library and facing this error while doing SSH to another machine. 我们正在使用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)

Can anyone explain what could be the issue here? 谁能解释这里的问题? Where should we start to debug from? 我们应该从哪里开始调试? SSH access from normal shell works correctly. 从普通外壳进行的SSH访问正常。

您的公钥可能存在问题

ssh failed after 141742-01/02 patch on solaris 10 ! solaris 10上的141742-01 / 02补丁后ssh失败!

Enabled aes192/aes256 support in ssh/sshd does not work on S10u3 or older released ssh / sshd中启用的aes192 / aes256支持在S10u3或更早版本上不起作用

A workaround is to disable the use of aes192/aes256 ciphers for ssh and sshd. 一种解决方法是禁用对ssh和sshd使用aes192 / aes256密码。 Change the two config files /etc/ssh/ssh_config and /etc/ssh/sshd_config and add the following line: 更改两个配置文件/ etc / ssh / ssh_config和/ etc / ssh / sshd_config并添加以下行:

Ciphers aes128-ctr,aes128-cbc,arcfour,3des-cbc,blowfish-cbc 密码aes128-ctr,aes128-cbc,arcfour,3des-cbc,河豚-cbc

You'll have to restart sshd to pickup the change (“svcadm restart ssh”). 您必须重新启动sshd以获取更改(“ svcadm restart ssh”)。

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM