Re: [JSch-users] Instruct Jsch to tell server to authenticate with "password" authentication
Status: Alpha
Brought to you by:
ymnk
From: <ym...@jc...> - 2010-07-29 06:46:09
|
Hi, +-From: Bradley Wagner <bra...@ha...> -- |_Date: Tue, 27 Jul 2010 23:00:44 -0400 _________________ | |I was wondering about Session#setUserInfo. What's the advantage of |using UserInfo over to just setting the password field? In the batch without any user interactions, there will not be the advantage. | Will using |this instruct the server to connect with the password auth method |first? To make it first, JSch ssh = new JSch(); Session session = ssh.getSession(<username>,<host>,<port>); session.setConfig("StrictHostKeyChecking", "no"); session.setConfig("PreferredAuthentications", "password,gssapi-with-mic,publickey,keyboard-interactive") session.setTimeout(15000); session.setPassword(<pass>); session.connect(); Sincerely, -- Atsuhiko Yamanaka JCraft,Inc. 1-14-20 HONCHO AOBA-KU, SENDAI, MIYAGI 980-0014 Japan. Tel +81-22-723-2150 +1-415-578-3454 Skype callto://jcraft/ Twitter: @ymnk |