ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Anderson, Rob (Global Trade)" <Rob.Ander...@nike.com>
Subject RE: reject HostKey error?
Date Wed, 21 Dec 2005 18:35:48 GMT
Add the trust="true" part to the scp task.

-Rob A 

> -----Original Message-----
> From: Rhino [mailto:rhino1@sympatico.ca] 
> Sent: Wednesday, December 21, 2005 6:44 AM
> To: ant-user
> Subject: Scp: reject HostKey error?
> 
> Now that I know how to make my sshexec task refer to the 
> proper keyfile, I am trying to update an older Ant script to 
> use sshexec and scp to access our server.
> 
> I am puzzled by an error I get from my scp task that doesn't 
> afflict my sshexec task, even though they use the same 
> properties. Here is the relevant property (with my hostname 
> munged for security)and my target:
> 
> -------------------------------
> <property name="server.hostname" value="www.bongo.com"/>
> 
> <!--other properties-->
> 
> <target name="upload-Bongo2">
> 
> <sshexec host="${server.hostname}" username="${userid}" trust="true"
> 
> keyfile="${server.keyfile}" passphrase="${server.passphrase}"
> 
> command="touch somefile2"/>
> 
> <scp file="build.xml"
> 
> todir="${userid}@${server.hostname}:/home/rhino"
> 
> keyfile="${server.keyfile}" passphrase="${server.passphrase}"/>
> 
> </target>
> 
> -------------------------------
> 
> And here is my error message, again with the host name munged 
> for security:
> -------------------------------
> BUILD FAILED
> 
> E:\eclipse\3.1.1\eclipse\workspace\Resume_JDK_1.5.0\xml\scp.xml:229: 
> com.jcraft.jsch.JSchException: reject HostKey: www.bongo.com
> 
> at 
> org.apache.tools.ant.taskdefs.optional.ssh.Scp.execute(Scp.java:187)
> 
> at 
> org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
> 
> at org.apache.tools.ant.Task.perform(Task.java:364)
> 
> at org.apache.tools.ant.Target.execute(Target.java:341)
> 
> at org.apache.tools.ant.Target.performTasks(Target.java:369)
> 
> at 
> org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)
> 
> at org.apache.tools.ant.Project.executeTarget(Project.java:1185)
> 
> at
> org.apache.tools.ant.helper.DefaultExecutor.executeTargets(Def
> aultExecutor.java:40)
> 
> at
> org.eclipse.ant.internal.ui.antsupport.EclipseDefaultExecutor.
> executeTargets(EclipseDefaultExecutor.java:32)
> 
> at org.apache.tools.ant.Project.executeTargets(Project.java:1068)
> 
> at
> org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.run(I
> nternalAntRunner.java:423)
> 
> at
> org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.main(
> InternalAntRunner.java:137)
> 
> Caused by: com.jcraft.jsch.JSchException: reject HostKey: www.tonge.ca
> 
> at com.jcraft.jsch.Session.checkHost(Unknown Source)
> 
> at com.jcraft.jsch.Session.connect(Unknown Source)
> 
> at com.jcraft.jsch.Session.connect(Unknown Source)
> 
> at
> org.apache.tools.ant.taskdefs.optional.ssh.SSHBase.openSession
> (SSHBase.java:180)
> 
> at org.apache.tools.ant.taskdefs.optional.ssh.Scp.upload(Scp.java:249)
> 
> at 
> org.apache.tools.ant.taskdefs.optional.ssh.Scp.execute(Scp.java:176)
> 
> ... 11 more
> 
> --- Nested Exception ---
> 
> com.jcraft.jsch.JSchException: reject HostKey: www.bongo.com
> 
> at com.jcraft.jsch.Session.checkHost(Unknown Source)
> 
> at com.jcraft.jsch.Session.connect(Unknown Source)
> 
> at com.jcraft.jsch.Session.connect(Unknown Source)
> 
> at
> org.apache.tools.ant.taskdefs.optional.ssh.SSHBase.openSession
> (SSHBase.java:180)
> 
> at org.apache.tools.ant.taskdefs.optional.ssh.Scp.upload(Scp.java:249)
> 
> at 
> org.apache.tools.ant.taskdefs.optional.ssh.Scp.execute(Scp.java:176)
> 
> at 
> org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
> 
> at org.apache.tools.ant.Task.perform(Task.java:364)
> 
> at org.apache.tools.ant.Target.execute(Target.java:341)
> 
> at org.apache.tools.ant.Target.performTasks(Target.java:369)
> 
> at 
> org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)
> 
> at org.apache.tools.ant.Project.executeTarget(Project.java:1185)
> 
> at
> org.apache.tools.ant.helper.DefaultExecutor.executeTargets(Def
> aultExecutor.java:40)
> 
> at
> org.eclipse.ant.internal.ui.antsupport.EclipseDefaultExecutor.
> executeTargets(EclipseDefaultExecutor.java:32)
> 
> at org.apache.tools.ant.Project.executeTargets(Project.java:1068)
> 
> at
> org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.run(I
> nternalAntRunner.java:423)
> 
> at
> org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.main(
> InternalAntRunner.java:137)
> 
> -------------------------------
> 
> Why is my domain name accepted by sshexec but rejected by scp 
> only a split second later? They are using the exact same 
> server.hostname property in their respective tasks. Both 
> sshexec and scp were written by the same company, JCraft, 
> which supports both tasks via the same jar. It wouldn't 
> surprise me if the same developer(s) wrote both tasks.
> 
> I am using Ant 1.6.5 in Eclipse 3.1.1. I am using 
> jsch-0.1.2.4.jar, which was the latest and greatest version 
> as of a couple of days ago.
> 
> Rhino
> 
> 
> 
> --
> No virus found in this outgoing message.
> Checked by AVG Free Edition.
> Version: 7.1.371 / Virus Database: 267.14.2/208 - Release 
> Date: 20/12/2005
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
> 
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message