While connecting with a jump server i wrote following code.
try
{
session = jsch.getSession(JumpServerUserName, JumpServerIP, 22);
session.setConfig("StrictHostKeyChecking", "no");
session.setPortForwardingL(localPort, JumpServerIP, 22);
session.setUserInfo(new MyUserInfo());
session.setPassword(e1);
session.connect();
}
catch(Exception tre)
{
System.out.println("The session could not be established to " + JumpServerUserName + "@" + JumpServerIP+new Timestamp(System.currentTimeMillis()));
}
The code worked fine but i was getting following messages.
Kerberos username [Username]:
Kerberos password for [Username]:
The messages didnt interfere with the functionality of the code but required user to click enter twice on the screen which was cumbersome.
Adding the below line was my solution.
session.setConfig(“PreferredAuthentications”,”publickey,keyboard-interactive,password”);
Happy Coding.
🙂
I pay a quick visit each day a few web pages and blogs to read
content, however this weblog gives feature based writing.
If you are going for most excellent contents like me, simply visit this web site every day for the reason that
it offers quality contents, thanks
Hi there it’s me, I am also visiting this website on a regular
basis, this web page is truly nice and the people are actually sharing pleasant thoughts.
This is my first time pay a quick visit at here and i am actually happy to read all at single place.