ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Thind, Aman" <>
Subject RE: Help Reqd on Scp & Sshexec...{Can't} Can get them to run :)
Date Thu, 12 Feb 2004 18:58:21 GMT

Rob and Jan

Thank you so so so much

I had been struggling at this for like days...

Earlier I was trying Perl Net::SSH module to work it out but it slowly got
out of hand

Saw that ant can do this so was grappling with it the whole day searching
through the list archives ( read a few mails by rob :) till I decided to
directly seek help of the mailing list...and this was my first mail !

I cannot thank you enough.

Cheers !

-----Original Message-----
From: Anderson, Rob (Global Trade) [] 
Sent: 12 February 2004 23:44
To: Ant Users List
Subject: RE: Help Reqd on Scp & Sshexec...Can't get them to run

Use ant the compile the jsch stuff. After unzipping the file, cd to jsch-0.1.13 and run "ant dist". Then copy the jar
from dist/lib/ to $ANT_HOME/lib.

In your build.xml you have not specified a known_hosts file. Therefore the
remote host key is being rejected...

"J:\build.xml:5: com.jcraft.jsch.JSchException: reject HostKey"

You should change your target to...

<sshexec host="my_ip"
 	command="touch somefile"/>

-Rob Anderson

> -----Original Message-----
> From: Thind, Aman []
> Sent: Thursday, February 12, 2004 9:42 AM
> To: ''
> Subject: Help Reqd on Scp & Sshexec...Can't get them to run
> Hello Friends,
> I have a two point task I intend to accomplish through ant :
> 1) Copy a tarball to a unix box using Scp
> 2) Issue an untar command to that unix box using Sshexec
> The ant script shall run on my windows machine.
> For these tasks I downloaded the from
> <> 
> This does not include the jsch.jar so I compiled it by -
> javac com/jcraft/jsch/*.java com/jcraft/jsch/jce/*.java and then
> Jar -cvf jsch.jar *
> And placed the jar in the ant/lib folder
> Now when I try to run the sshexec task by the build file :
> (all ip etc info replaced)
> -------------------------------------------------------
> <project name="MyProject" default="dist" basedir=".">
> <sshexec host="my_ip"
> 	username="my_username"
> 	password="my_passwd"
> 	command="touch somefile"/>
> </project>
> ----------------------------------------------------------
> I get the error :
> -------------------------------------------------------------
> J:\>ant
> Buildfile: build.xml
>   [sshexec] Connecting to my_ip:22
> J:\build.xml:5: com.jcraft.jsch.JSchException: reject HostKey
> Total time: 9 seconds
> -----------------------------------------------------------------
> Can someone please shed some light on this and point me in the correct
> direction.
> A link to precompiled jsch.jar could be helpful to rule out 
> any issues in my
> building of the jar.
> Thank you all so much
> -aman

To unsubscribe, e-mail:
For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message