Reputation: 51
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)
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.
So please help me. Thank you
Upvotes: 4
Views: 12216
Reputation: 1225
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
Above should be put placed:
/etc/ssh/sshd_config
And then restart the ssh:
sudo /etc/init.d/ssh restart
Upvotes: 6