ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rhino" <>
Subject Re: Question re SSH2/Scp/Sshexec
Date Fri, 08 Oct 2004 23:33:38 GMT

Are you *sure* that the SSH1 and SSH2 formats are the same for the
known_hosts file? According to the Ant Manual writeup for the 'knownhosts'
parameter Scp (and Sshexec):

This sets the known hosts file to use to validate the identity of the remote
host. This must be a SSH2 format file. SSH1 format is not supported.

On the assumption that you were right and the manual was wrong, I went ahead
and created a knownhosts file that had the format cited in your URL. I set
my 'trust' parameter to 'false' and set 'knownhosts' to point at the
location of the knownhosts file that I had created and set Ant to -debug.
According to the output from my Scp step:

Adding reference: eclipse.progress.monitor

[scp] Using known hosts: d:\eclipse\workspace\resume\xml\known_hosts.txt

[scp] BUILD FAILED: D:\eclipse\workspace\Resume\xml\ssh.xml:78:
com.jcraft.jsch.JSchException: java.lang.ArrayIndexOutOfBoundsException: 313


It looks like it is finding the knownhosts file just fine but it doesn't
seem to like what it finds there.

I am satisfied that the knownhosts file was constructed according to the
rules in the man page and I carefully copied the bits, exponent, and modulus
from the file in the host's /etc/ssh directory beside the

I'm really not sure if you're right and that the SSH1 and SSH2 formats are
the same, despite the manual's remarks, or if they are different. If you are
right and the formats are the same, then perhaps I have just made a mistake
in creating the file, despite proceeding cautiously. Otherwise, I'd love to
find some documentation for the SSH2 format and make the necessary changes
so that I can get this working.

Is there any way to be sure what the SSH2 format for the knownhosts file is?
Even a categorical declaration in an authoritative source that the
knownhosts file format is the same for both SSH1 and SSH2 would be useful to


----- Original Message ----- 
From: "Dale Anson" <>
To: "Ant Users List" <>
Cc: "ant-user" <>
Sent: Friday, October 08, 2004 5:34 PM
Subject: Re: Question re SSH2/Scp/Sshexec

> I don't think there is any difference in format between ssh1 and ssh2
> known_hosts files.  The details of the file format are in the man pages
> for sshd(8), on line at
> >
> > Can anyone point me to an example of a knownhosts file that is in SSH2
> > format?
> >
> > According to the articles on the (optional) Scp and Sshexec tasks in the
> > Ant Manual, both tasks can specify a file in the 'knownhosts' parameter
> > and that file must be in SSH2 format. I'd like to create such a file but
> > haven't been able to find an example anywhere so that I know what to
> > create.
> >
> > Also, how would I go about suggesting to the developer of these tasks
> > he include an example of the knownhosts file in the documentation for
> > these two tasks? Otherwise, there are bound to be other people asking
> > same question time and time again.
> >
> > Rhino
> > ---
> > rhino1 AT sympatico DOT ca
> > "There are two ways of constructing a software design. One way is to
> > it so simple that there are obviously no deficiencies. And the other way
> > is to make it so complicated that there are no obvious deficiencies." -
> > C.A.R. Hoare
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

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

View raw message