I want to execute a UNIX command from my local Windows XP system using ANT script. UNIX system is a remote server.
I have tried the following:
<target name="execute" >
<sshexec host="host IP"
username="uname"
password="pass"
commandResource="sh abc.sh"/>
</target>
but got the error below:
BUILD FAILED
..\build.xml:49: com.jcraft.jsch.JSchException: con开发者_运维技巧nection is closed by foreign
host
take a look at the sshexec ant task. You will need a jsch library on the ant classpath and the UNIX server needs to be running a ssh daemon.
精彩评论