error message:
Com.jcraft.jsch.JSchException:Algorithm Negotiation Fail
Problem Analysis:
The sshd configuration does not open an algorithm that supports Jsch jar requirements, the default open algorithm can be seen in the man sshd_config, it is possible that the advanced version of sshd turns off some of the algorithms by default (version 7.5 has this problem).
Hash algorithm view: Ssh-q mac
KEX algorithm view: Ssh-q KEX
Transfer encryption Algorithm view: Ssh-q cipher
The above command to see the algorithm is the SSHD support algorithm, not the algorithm has been opened
Solution:
in the /etc/ssh/sshd_config at the end of the file Add command line, open the algorithm:
Kexalgorithms DIFFIE-HELLMAN-GROUP1-SHA1,DIFFIE-HELLMAN-GROUP14-SHA1,DIFFIE-HELLMAN-GROUP-EXCHANGE-SHA1, diffie-hellman-group-exchange-sha256,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521, Diffie-hellman-group1-sha1,[email protected]
Ciphers aes128-cbc,aes192-cbc,aes256-cbc,aes128-ctr,aes192-ctr,aes256-ctr,3des-cbc,arcfour128,arcfour256, Arcfour,blowfish-cbc,cast128-cbc
Restart Service: Service sshd Restart
Problem solving.
Jsch jar package not connected to SSH algorithm negotiation fail error