-1

I am trying to connect to a server using JSch. I get the "Negotiation fail" error. I checked the sshd_config file and got the following info:

UsePAM yes
PasswordAuthentication no
Ciphers aes128-ctr,aes256-ctr,arcfour256,arcfour,aes128-cbc,aes256-cbc
AllowTcpForwarding no
PermitRootLogin no

The rest of the scripts are commented out. As you see it doesn't mention anything about supported Key Exchange methods. 1. Does this seem to be the problem? or is there any other reason this error shows up? It is very hard for me to get the approval to make changes and test, so I wanted to make sure first and then apply the changes.

Also, this is all I get from the logger:

INFO: Connecting to xx.xxx.xxx.xxx port 22
INFO: Connection established
INFO: Remote version string: SSH-2.0-OpenSSH_5.1
INFO: Local version string: SSH-2.0-JSCH-0.1.31
INFO: SSH_MSG_KEXINIT received
INFO: SSH_MSG_KEXINIT sent
Exception in thread "main" com.jcraft.jsch.JSchException: Algorithm negotiation fail
    at com.jcraft.jsch.Session.receive_kexinit(Session.java:540)
    at com.jcraft.jsch.Session.connect(Session.java:288)
    at com.jcraft.jsch.Session.connect(Session.java:145)
    at SSHConnection.connect(SSHConnection.java:21)
    at SSHConnection.main(SSHConnection.java:25)
  1. Is there any other ways to find out the Key Exchange methods supported by the server?
  2. Are there other ways to connect to this server? I need to integrate this into my Java program.
4

1 回答 1

0

我发现了问题,原来我必须下载 Java Cryptography Extension (JCE) 并将文件替换为以下路径中安全文件夹中存在的文件:C:\Program Files\Java\jre6\lib\安全\

希望这会帮助有同样问题的人。

于 2015-06-04T14:05:38.040 回答