Even a recently changed host key should be accepted when trust="true", since it is not compared to a local knownhosts file. The command line client complains because it will allways compare the host key to the local knownhosts file. I have tried to reproduce the error with trust="true", but am unable to.
>From the line numbers in the stack trace, I suspect you are not using the version of Ant that you think you are using. Or perhaps you have compiled Ant from source and have made some modifications? In the Ant source code for version 1.6.5 there is no exception thrown on line 211, as indicated by your stack trace. Here is what I get without trust="true"... at org.apache.tools.ant.taskdefs.optional.ssh.SSHExec.execute(SSHExec.java: 258) -Rob Andeson > -----Original Message----- > From: Steve Loughran [mailto:[EMAIL PROTECTED] > Sent: Thursday, September 06, 2007 6:29 AM > To: Ant Users List > Subject: Re: sshexec > > Anderson, Rob (Global Trade) wrote: > > Usually this error is caused when you have not specified either > > trust="true" or knownhosts="something". You have set trust="true" > > though...I'm not sure what is causing the problem. > > > Has the host changed its key recently? That may trigger > something; it certainly does on command line ssh > > > > > What version of Ant? What version of jsch? Can you ssh into > the host > > with an ssh client? What version is the ssh server? OpenSSH > or other? > > > > Also, produce some output with -verbose and sent it. > > > > -Rob Anderson > > > >> -----Original Message----- > >> From: Shankar S [mailto:[EMAIL PROTECTED] > >> Sent: Wednesday, September 05, 2007 12:52 AM > >> To: Ant Users List > >> Subject: sshexec > >> > >> I have got the sshexec task in this format: > >> > >> <sshexec host="xxx" username="xxx" password="xxx" command="./xx.sh" > >> trust="true" /> > >> > >> Ant throws up saying: > >> > >> com.jcraft.jsch.JSchException: reject HostKey: xxx > >> > >> Any help on this is much appreciated. > >> > >> -Shanki > >> > > > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: [EMAIL PROTECTED] For > additional > > commands, e-mail: [EMAIL PROTECTED] > > > > > -- > Steve Loughran http://www.1060.org/blogxter/publish/5 > Author: Ant in Action http://antbook.org/ > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] For > additional commands, e-mail: [EMAIL PROTECTED] > > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]