Is there a way to tell JSch to tell the server to use password auth
from the start rather than trying different auth methods?

I have the following code:

JSch ssh = new JSch();
Session session = ssh.getSession(<username>,<host>,<port>);
session.setConfig("StrictHostKeyChecking", "no");
session.setTimeout(15000);
session.setPassword(<pass>);
session.connect();

which is resulting in "Auth fail".  I confirmed that password
authentication is enabled on the remote machine.

It appears from the SSH log (below) that it's trying to authenticate
against the server with methods: none, gssapi, and
keyboard-interactive before eventually failing with on "password" auth
possibly because we've failed too many times already.

debug1: userauth-request for user cmspol service ssh-connection method none
debug1: attempt 0 initial attempt 0 failures 0 initial failures 0
debug2: input_userauth_request: setting up authctxt for cmspol
debug2: input_userauth_request: try method none
Failed none for cmspol from 128.200.168.182 port 56182 ssh2
debug1: userauth-request for user cmspol service ssh-connection method
gssapi-with-mic
debug1: attempt 1 initial attempt 0 failures 1 initial failures 0
debug2: input_userauth_request: try method gssapi-with-mic
debug1: Client offered gssapi userauth with { 1 2 840 113554 1 2 2 }
(supported)debug1: userauth-request for user cmspol service ssh-connection
method keyboard-interactive
debug1: attempt 2 initial attempt 0 failures 1 initial failures 0
debug2: input_userauth_request: try method keyboard-interactive
debug1: keyboard-interactive devs
debug2: Starting PAM service sshd-kbdint for method keyboard-interactive
debug3: Trying to reverse map address 128.200.168.182.
debug2: Calling pam_authenticate()
debug2: PAM echo off prompt: Enter your Unix PASSWORD:
debug2: Nesting dispatch_run loop
debug1: got 1 responses
debug2: Nested dispatch_run loop exited
debug1: PAM conv function returns PAM_SUCCESS
Keyboard-interactive (PAM) userauth failed[9] while authenticating:
Authentication failed
Failed keyboard-interactive for cmspol from 128.200.168.182 port 56182 ssh2
debug1: userauth-request for user cmspol service ssh-connection method password
debug1: attempt 3 initial attempt 1 failures 3 initial failures 1
debug2: Unrecognized authentication method name: password
Failed password for cmspol from 128.200.168.182 port 56182 ssh2
Received disconnect from 128.200.168.182: 3:
com.jcraft.jsch.JSchException: Auth
fail
debug1: Calling cleanup 0x26b58(0x8d0e0)
debug1: Calling cleanup 0x20038(0x8ff40)
debug1: Calling cleanup 0x46370(0x0)
Connection closed by 128.200.168.182
monitor debug1: Calling cleanup 0x46370(0x0)
monitor debug1: Calling cleanup 0x46370(0x0)

------------------------------------------------------------------------------
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share 
of $1 Million in cash or HP Products. Visit us here for more details:
http://ad.doubleclick.net/clk;226879339;13503038;l?
http://clk.atdmt.com/CRS/go/247765532/direct/01/
_______________________________________________
JSch-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jsch-users

Reply via email to