I want to automate connect to a ssh server with keyboard-interactive authentication(or challenge-response authentication) using jsch. I'd already set userinfo and config like this.
session.setUserInfo(myUserInfo);
session.setConfig("StrictHostKeyChecking", "no");
session.setConfig("PreferredAuthentications",
"publickey,keyboard-interactive,password");
myUserInfo object implement the UserInfo interface When I debug the source, I'm always getting a com.jcraft.jsch.JSchException: Auth fail exception. Somebody said myUserInfo should implement UIKeyboardInteractive. But I can't understand the official JSch UserAuthKI example. It's too complicated to understand. I just want get a connection automate. Who can give me a simple example, please. Thanks.