本文介绍了com.jcraft.jsch.JSchException:算法协商失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试从客户端计算机连接sftp服务器。但是com.jcraft.jsch.JSchException:算法协商失败了我遇到的这种错误。

I am trying to connect with sftp server from client machine. But com.jcraft.jsch.JSchException: Algorithm negotiation fail this kind of error i am getting.

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 com.na.common.NewReading.main(NewReading.java:28)

我尝试使用,并且我已经更改了sshd_config中的KexAlgorithms,但出现了错误。

i have tried to resolve this by using Algorithm negotiation fail SSH in Jenkins and i have changed the KexAlgorithms in sshd_config, but getting the error.

所以请帮助我。谢谢

推荐答案

在我的情况下-服务器上的OpenSSH_6.7p1-我必须修改KexAlgorithms和MAC(其他hmac-md5, hmac-sha1,hmac-sha1-96,hmac-md5-96值):

In my case - OpenSSH_6.7p1 on server - I had to modify KexAlgorithms and MACs (additional hmac-md5,hmac-sha1,hmac-sha1-96,hmac-md5-96 values):

KexAlgorithms [email protected],ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group14-sha1,diffie-hellman-group-exchange-sha1,diffie-hellman-group1-sha1

MACs [email protected],[email protected],[email protected],[email protected],hmac-sha2-512,hmac-sha2-256,hmac-ripemd160,[email protected],hmac-md5,hmac-sha1,hmac-sha1-96,hmac-md5-96

应放在上方:

/etc/ssh/sshd_config

然后重新启动ssh:

And then restart the ssh:

sudo /etc/init.d/ssh restart

这篇关于com.jcraft.jsch.JSchException:算法协商失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-12 07:50