You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by MaxSteel <ma...@gmail.com> on 2008/04/29 06:58:51 UTC

Ant on AIX using SCP to transfer files with ssh2 keys

Hey everyone, I'm hoping you can shed some light on this for me.  I'm new to
ANT and am trying to troubleshoot an issue.  I have searched high and low
and all the answers that I found do not seem to work with my configuration.

I have successfully gotten scp to work using user/pass authentication in an
ant script, but I cannot get it to work with ssh2 keys.

Since my passwords expire every 90 days it's become troublesome (cronned ant
script failing because the userid is expired), so I'd like to gets keys
working.

1) I have ssh2 keys set up on serverSOURCE and serverDEST.
2) I can successfully ssh and scp in AIX from serverSOURCE to serverDEST no
problems (no password is needed).
3) I cannot get ANT's scp script to do the same.

Here is my build.xml that I was playing with:

-------------------------------------------------------------------
<?xml version="1.0"?>
  <project name="scp" basedir="." default="go">
    <target name="go">
    <scp file       = "user@server:/usr/somefile.txt"
         keyfile = "/home/user/.ssh2/id_dsa_2048_a"
         passphrase = ""
         todir      = "."
         trust      = "true"
         port       = "22"
         verbose    = "true"
         sftp       = "true" />
    </target>
  </project>
-------------------------------------------------------------------

ANT VERSION: 1.7.0 : jsch-0.1.37.jar
OS: AIX 5.3

Any help is appreciated!
Max

-- 
View this message in context: http://www.nabble.com/Ant-on-AIX-using-SCP-to-transfer-files-with-ssh2-keys-tp16952909p16952909.html
Sent from the Ant - Users mailing list archive at Nabble.com.


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


Re: Ant on AIX using SCP to transfer files with ssh2 keys

Posted by MaxSteel <ma...@gmail.com>.
First, does jsch need this "known hosts" file.. is that why it's not working?
if so, what should this file look like for ssh2?

Second, Does my script look correct at least for keys to work?
--------------------------------------------------------------------
"build.xml" 17 lines, 713 characters
<?xml version="1.0"?>
  <project name="scp" basedir="." default="go">
    <target name="go">
    <scp file       =
"user@iedm2a24:/usr/WebSphere/AppServer6/profiles/serverindex.xml"
         keyfile = "/home/user/.ssh2/id_dsa_2048_a"
         passphrase = ""
         todir      = "."
         trust      = "true"
         port       = "22"
         verbose    = "true"
         sftp       = "true" />
    </target>
  </project>
--------------------------------------------------------------------



-- 
View this message in context: http://www.nabble.com/Ant-on-AIX-using-SCP-to-transfer-files-with-ssh2-keys-tp16952909p16986532.html
Sent from the Ant - Users mailing list archive at Nabble.com.


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


Re: Ant on AIX using SCP to transfer files with ssh2 keys

Posted by Atsuhiko Yamanaka <at...@gmail.com>.
Hi,

2008/4/30 MaxSteel <ma...@gmail.com>:
>
> So from my research, I am using jsch on apache-ant v1.7.0
>
> Also, the type of keys I am using on these servers is known as "tectia
> keys".

I don't know about "tectia keys",
but jsch only accepts private keys in openssh format.

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


Re: Ant on AIX using SCP to transfer files with ssh2 keys

Posted by MaxSteel <ma...@gmail.com>.
So from my research, I am using jsch on apache-ant v1.7.0

Also, the type of keys I am using on these servers is known as "tectia
keys".

No known_hosts file is created, only a directory called "hostkeys" in
home/user/.ssh2/hostkeys is created with separate public keys in separate
fies in this directory.

If this helps I hope so.. I'n beginning to think that I cannot scp this way
with this type of keys.

Thanks..
-- 
View this message in context: http://www.nabble.com/Ant-on-AIX-using-SCP-to-transfer-files-with-ssh2-keys-tp16952909p16970941.html
Sent from the Ant - Users mailing list archive at Nabble.com.


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


RE: Ant on AIX using SCP to transfer files with ssh2 keys

Posted by "Anderson, Rob (Global Trade)" <Ro...@nike.com>.
You do not need a known_hosts file since you have set trust="true". You
will need to generate a key pair on the machine running ant. You may
need to convert the private key to openssh format. Use the private key
file in the ant build file...
keyfile = "path/to/key/file"
...

Then you need to copy the public key to the remote server and put it in
/home/user-that-you-are-connecting-as/.ssh2

Create a file on the remote system called...
/home/user-that-you-are-connecting-as/.ssh2/authorization

...with the contents...

key name-of-your-public-key

-Rob Anderson


-----Original Message-----
From: MaxSteel [mailto:maxsteel@gmail.com] 
Sent: Wednesday, April 30, 2008 9:38 AM
To: user@ant.apache.org
Subject: Re: Ant on AIX using SCP to transfer files with ssh2 keys


Update, finally got a straight answer from one of my sys admins, we are
using:
"WRQ's version of SSH2 which used to be F-Secure"

If that helps.. thanks.
-- 
View this message in context:
http://www.nabble.com/Ant-on-AIX-using-SCP-to-transfer-files-with-ssh2-k
eys-tp16952909p16986856.html
Sent from the Ant - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
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


Re: Ant on AIX using SCP to transfer files with ssh2 keys

Posted by MaxSteel <ma...@gmail.com>.
Update, finally got a straight answer from one of my sys admins, we are
using:
"WRQ's version of SSH2 which used to be F-Secure"

If that helps.. thanks.
-- 
View this message in context: http://www.nabble.com/Ant-on-AIX-using-SCP-to-transfer-files-with-ssh2-keys-tp16952909p16986856.html
Sent from the Ant - Users mailing list archive at Nabble.com.


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