JSch算法协商失败

我尝试通过Java连接SFTP服务器。


我有一个错误。


com.jcraft.jsch.JSchException:算法协商失败


这是POM:


<dependency>

            <groupId>com.jcraft</groupId>

            <artifactId>jsch</artifactId>

            <version>0.1.53</version>

</dependency>

这是日志:


INFO: Connecting to **"FTP ADRESS"** port 22

INFO: Connection established

INFO: Remote version string: SSH-2.0-Maverick_SSHD

INFO: Local version string: SSH-2.0-JSCH-0.1.53

INFO: CheckCiphers: aes256-ctr,aes192-ctr,aes128-ctr,aes256-cbc,aes192-cbc,aes128-cbc,3des-ctr,arcfour,arcfour128,arcfour256

INFO: aes256-ctr is not available.

INFO: aes192-ctr is not available.

INFO: aes256-cbc is not available.

INFO: aes192-cbc is not available.

INFO: CheckKexes: diffie-hellman-group14-sha1,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521

INFO: diffie-hellman-group14-sha1 is not available.

INFO: ecdh-sha2-nistp256 is not available.

INFO: ecdh-sha2-nistp384 is not available.

INFO: ecdh-sha2-nistp521 is not available.

INFO: CheckSignatures: ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521

INFO: ecdsa-sha2-nistp256 is not available.

INFO: ecdsa-sha2-nistp384 is not available.

INFO: ecdsa-sha2-nistp521 is not available.

INFO: SSH_MSG_KEXINIT sent

INFO: SSH_MSG_KEXINIT received

INFO: kex: server: diffie-hellman-group1-sha1,diffie-hellman-group-exchange-sha1

INFO: kex: server: ssh-rsa

INFO: kex: server: aes256-cbc,aes192-cbc

INFO: kex: server: aes256-cbc,aes192-cbc

INFO: kex: server: hmac-sha1,hmac-sha1-96

INFO: kex: server: hmac-sha1,hmac-sha1-96

INFO: kex: server: none

INFO: kex: server: none

INFO: kex: server: 

INFO: kex: server: 

INFO: kex: client: diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group1-sha1

INFO: kex: client: ssh-rsa,ssh-dss

INFO: kex: client: aes128-ctr,aes128-cbc,3des-ctr,3des-cbc,blowfish-cbc

INFO: kex: client: aes128-ctr,aes128-cbc,3des-ctr,3des-cbc,blowfish-cbc

我收到此错误,尝试解决。我无法访问SFTP服务器来下载或更新任何文件等。

红糖糍粑
浏览 1112回答 3
3回答

精慕HU

如您所见,服务器提供以下密码:信息:kex:服务器:aes256-cbc,aes192-cbc但是JSch仅接受以下内容:信息:kex:客户端:aes128-ctr,aes128-cbc,3des-ctr,3des-cbc,blowfish-cbc没有通用的密码可供选择。请注意,JSch确实支持aes256-cbc和aes192-cbc,但是需要JCE(Java密码学扩展)来允许它们。您可能没有JCE,因此这些密码不可用。这就是为什么信息:aes256-cbc不可用。下载Java密码学扩展(JCE)无限强度管辖权策略文件8(或其他版本,如果未使用JDK 1.8)。

拉丁的传说

我解决了将库jsch-0.1.27.jar更新为jsch-0.1.54.jar的问题。最后,在代码中,您应该编写如下代码:your Method {&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp;session.setConfig("StrictHostKeyChecking", "no");// That solve the problem.&nbsp; &nbsp; }如果您需要此Java版本,则此代码可在Java 1.5或更高版本中使用。

茅侃侃

如何在openSSH窗口中执行此操作?我尝试了这个,但是我什至无法启动我的openSSH服务,它遇到了错误的配置选项:KexAlgorithms
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

Java