简体   繁体   中英

SSH using jschexception verify false sometimes fails

The requirement is to ssh from one server to multiple server and execute a command.

When I do this I frequently, but not always, receive this exception when trying to ssh from one server to another. What could be the reason for this and how can it be fixed? Any help could be great. Thanks in advance!

jcraft.jsch.JSchException: verify: false 
     at jcraft.jsch.Session.connect(Session.java:309) 
     at jcraft.jsch.Session.connect(Session.java:162)

jsch 0.1.50 has been released and it fixes this problem.

The download page for jsch is http://www.jcraft.com/jsch/

I have experienced the same problem using Java 1.7.0_07 on Windows 64 bits together with Ant 1.7.1 and jsch-0.1.44.jar. Also using Ant 1.9.0-alpha and jsch-0.1.49. I have reported this issue on the tracker of jsch at sourceforge .

A similar bug report has been made by someone using Ivy, jsch and Java 1.7 IVY-1374

Users of gradle also reported the same as gradle-ssh-plugin issue 11.

The problem persist, the other 2 answer are right.

1) exist a bug in versions before 0.1.49 in version 0.1.49 was theoretically fixed here is the change log

2) exist an interaction between java 1.7 and jsch and in that circunstancies the bug appear

It happen to me all the time. I believe that it happen because some plugin don't update their dependencies and they have jsch lower than 0.1.50 as include.

IE: ssh credential plugin https://github.com/jenkinsci/ssh-credentials-plugin

I add a pull request to change the dependencies but they don't answer yet.

The fix @antoine mentioned is actually in 0.1.51 not 0.1.50, I guess jsch changlog's confusing wording is to blame : "Changes since version 0.1.50" means 0.1.51

Following page "[JSch-users] ANNOUNCE: JSch 0.1.51" should be more clear https://sourceforge.net/p/jsch/mailman/message/32115165/

It says

JSch 0.1.51 has been released. It is available at
http://sourceforge.net/projects/jsch/files/jsch/0.1.51/jsch-0.1.51.zip/download and its md5sum is 89d0ff6d36040622da0a482e51d87725 And you can get its byte code in jar file format at
http://sourceforge.net/projects/jsch/files/jsch.jar/0.1.51/jsch-0.1.51.jar/download and its md5sum is de3a2b0d03295f167fea1904939443cf

Changes since version 0.1.50: - bugfix: reproducibility of "verify: false". FIXED. The hundreds of thousands connections had caused that exception.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM