Bradley Wagner <bradley.wagner@...> writes: > > On Tue, Jul 27, 2010 at 9:57 PM, Atsuhiko Yamanaka <ymnk@...> wrote: > > Hi, > > > > +-From: Bradley Wagner <bradley.wagner@...> -- > > |_Date: Tue, 27 Jul 2010 17:13:22 -0400 _________________ > > | > > |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.setConfig("PreferredAuthentications", "password"); > > > > |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. > > > > But, it seems that remote sshd has claimed that it does know about > > "password" auth method, > > > > ... > > |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 > > ... > > Yes, I noticed this too. We *think* this is because the auth failed on > 3 earlier occasions but I agree this message is suspicious. We've > verified that the > > PasswordAuthentication yes > > option is enabled in the sshd_config. > > > I guess that you had logged-in with keyboard-interactive auth method > > with other ssh clients. If so and you don't want to implement > > the com.jcraft.jsh.UIKeyboardInteractive interface , try jsch-0.1.43 . > > How would this affect authentication being done with JSch? Also, what > has changed in jsch-0.1.43 to affect this? > > > > > 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: <at> ymnk > > > > Thanks, > Bradley > > -------------------------------------------------------------------------- ---- > 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/ >
Hi, I have used JSCH library to use SFTP as a batch process. Hence I am not using the interactive keyboard "userinfo" that was available as part of the example, but I am getting the userinfo populated from UI available in my application. I have used the following piece of code: JSch jsch=new JSch(); String userName=userInfo.getUserName(); String hostName=userInfo.getHostName(); int port=22; session=jsch.getSession(userName, hostName, port); String password=userInfo.getPassword(); session.setPassword(password.getBytes()); java.util.Properties config = new java.util.Properties(); config.put("StrictHostKeyChecking", "no"); session.setConfig(config); session.connect(); The code worked perfectly for many of the servers. But it was showing an error "Auth Cancel" for a specific server. So after reading the article above I added the following line of code: session.setConfig("PreferredAuthentications","password"); Now the error coming is "Auth fail". Please let me know how to proceed. I would also like to add that the specific server that was failing had PAM authentication(not sure if this is the reason that its failing). ------------------------------------------------------------------------------ AlienVault Unified Security Management (USM) platform delivers complete security visibility with the essential security capabilities. Easily and efficiently configure, manage, and operate all of your security controls from a single console and one unified framework. Download a free trial. http://p.sf.net/sfu/alienvault_d2d _______________________________________________ JSch-users mailing list JSch-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jsch-users