Have you tried
config.put("PreferredAuthentications",
"publickey,keyboard-interactive,password");
From: Răzvan Rotaru <razvan.rot...@gmail.com>
Sent: Friday, October 14, 2016 11:49:45 AM
To: jsch-users@lists.sourceforge.net
Subject: [
Hi Jsch community,
I am looking to use both password and key authentication in a single
connect call, so that
the password authentication is used as backup in case the key
authentication fails.
Adding the key with Jsch.addIdentity and password with Session.setUserInfo
does not yield this