ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dale Anson <>
Subject Re: ssh task - doesn't behave the same as command line ssh
Date Mon, 21 Apr 2003 23:54:40 GMT
I concur with Rob, use sshexec. It will be released with Ant 1.6 as an 
optional task. You can get it from Ant cvs, or you can download a ready 
to use jar from


Matt Reason wrote:

>I am using the ssh task to connect to a remote server and fire off a
>shell script that deploys files from a big tarball into the htdoc dir of
>that server.
>The code looks something like this:
> <taskdef name="ssh" classname="com.sshtools.ant.Ssh">
>    <classpath refid="project.class.path"/>
> </taskdef> 
> <target name="ssh">
>     <ssh host="tecate" verifyhost="false" username="w3admin"
>        <exec cmd="./ > matt.log"/>
>     </ssh> 
> </target>
>      [ssh] Initializing J2SSH
>      [ssh] Creating connection to tecate:22
>      [ssh] Connecting....
>      [ssh] Authenticating w3admin
>      [ssh] Performing password authentication
>      [ssh] Authentication complete
>      [ssh] Executing ./ > matt.log
>When I run this target, the thing just hangs.  The shell doesn't
>complete and the java process on my local machine goes crazy and takes
>up 100% of the CPU.  I've also tried it without the output re-direct.
>If I was to login to the remote machine using ssh on the comand line and
>then execute the shell, it works perfectly and takes about 2 seconds.
>Anybody know what I'm doing wrong?  Should I be using SSHExec?
>Thanks in advance,

View raw message