aspose file tools
The moose likes Ant, Maven and Other Build Tools and the fly likes Ant SshExec task throwing JschException : Auth fail Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of Practical Unit Testing with TestNG and Mockito this week in the Testing forum!
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Reply Bookmark "Ant SshExec task throwing JschException : Auth fail" Watch "Ant SshExec task throwing JschException : Auth fail" New topic
Author

Ant SshExec task throwing JschException : Auth fail

Sonny Gill
Ranch Hand

Joined: Feb 02, 2002
Posts: 1209

Hi guys,

This script was working fine, but stopped working after the remote server was upgraded from Suse 9 to Suse9.1 .
The problem should not be the ssh hosts file, because I can use ssh directly to connect without a problem, and also if I remove that file, ant throws a different exception (something along the lines of Host lookup failed).
I am really stumped that why the authorization is failing when the password is included right there in the script (I know that is not very secure, this is to get it working)

Any help is greatly appreciated!


Following is the stripped down ant script -


And the exception thrown is -

Sonny Gill
Ranch Hand

Joined: Feb 02, 2002
Posts: 1209

So...I happened to find out why this was happening.
The reason the script started to fail must have been a configuration change on the remote system.

Ref - http://sancho-gui.sourceforge.net/faq.phtml


SSH2 NOTE: (might not be required if using 0.9.4-22 or newer and id_dsa)

In order for SSH2 tunneling to function correctly one must ensure that the
following line is uncommented in /etc/ssh/sshd_config :
--------------------------CUT-------------------------------
# Change to yes to enable tunnelled clear text passwords
PasswordAuthentication yes
--------------------------CUT-------------------------------

Otherwise the initiation of the tunnel will fail with
"SSH Initialization failed, try again?
com.jcraft.jsch.JSchException: Auth fail"


Thanks to whoever posted the above faq entry

After editing my remote sshd configuration, I can run the script again.

A discussion of what this setting means can be found here -
http://www.lugod.org/mailinglists/archives/vox-tech/2005-07/msg00012.html

Sonny
 
 
subject: Ant SshExec task throwing JschException : Auth fail
 
Threads others viewed
Wrapping an existing core Ant task
Ant and scp
SCP task in Ant
ftpclient class not found?
ANT - JUNIT problems
developer file tools