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: ant exec and ssh-agent
Date Fri, 27 Feb 2004 20:38:14 GMT
You want to use the scp task, not the sshexec task. If you want to use the exec task you will
need to do the following. 

1. Start ssh-agent and capture the output in a file.
2. Add the key you intend to authenticate with to the agent.
3. Write a script that sources the file you created in step 1 before connecting to the remote
host

You will basically use Ant as a wrapper for the script that does the actual copy. Not the
best solution, but it would work. 

Does anyone know if Jsch supports ssh-agent? If so, this functionality could be added to the
ssh tasks. Last time I checked it did not.

-Rob Anderson

> -----Original Message-----
> From: Faine, Mark [mailto:Mark.R.Faine@msfc.nasa.gov]
> Sent: Friday, February 27, 2004 9:29 AM
> To: 'Ant Users List'
> Subject: RE: ant exec and ssh-agent
> 
> 
> I don't understand how I can do it with sshExec, maybe I can 
> use it to stop
> and start the server, or run some command on the remote 
> system but how do I
> use it transfer a file from system a to system b where system b is the
> remote server.
> 
> -Mark
> 
> 
> -----Original Message-----
> From: Hugo Costa [mailto:hcosta@xlm.pt] 
> Sent: Friday, February 27, 2004 9:13 AM
> To: Ant Users List
> Subject: RE: ant exec and ssh-agent
> 
> 
> Hi,
> 
> I think you could look into the SSHExec task, it also uses 
> the external jar,
> but it could do what you want. It's just another thought!
> 
> Hugo
> 
> On Fri, 2004-02-27 at 15:00, Faine, Mark wrote:
> > I did try the SCP task, in fact I started with it, but 
> decided against 
> > its use unless absolutely necessary because it requires an 
> additional
> > (third-party) jar file that is not available on every machine that 
> > could run this script.  I'd like to keep this ant script 
> very portable 
> > and have taken great care in developing it to be just that.  Anyway 
> > the failure of the scp task is what lead me to trying the 
> exec task to 
> > begin with.  The scp task fails with the following message:
> > 
> > BUILD FAILED
> > /export/home/admin/transfer.xml:36: neither password nor passphrase 
> > for user admin has been given.  Can't authenticate.
> > 
> > I would think because I didn't give it a password.  If I 
> have to give 
> > it a password I'm defeating the purpose of the entire 
> automation.  We 
> > do not want to store passwords. Which brings me back to using 
> > ssh-agent, and my original
> > question: 
> > 
> > Can the scp task or the exec task support ssh-agent? If not does 
> > anyone know of a work around, so that I do not have to store the 
> > password. For example, can I add the identity to the agent 
> in a shell 
> > script and then run the ant task from the shell script?  
> Just looking 
> > for ideas.
> > 
> > Thanks,
> > -Mark
> > 
> > 
> > -----Original Message-----
> > From: Jan.Materne@rzf.fin-nrw.de [mailto:Jan.Materne@rzf.fin-nrw.de]
> > Sent: Friday, February 27, 2004 8:07 AM
> > To: user@ant.apache.org
> > Subject: RE: ant exec and ssh-agent
> > 
> > 
> > Try <scp> task :)
> > 
> > Jan
> > 
> > > -----Original Message-----
> > > From: Faine, Mark [mailto:Mark.R.Faine@msfc.nasa.gov]
> > > Sent: Friday, February 27, 2004 3:03 PM
> > > To: 'user@ant.apache.org'
> > > Subject: ant exec and ssh-agent
> > > 
> > > 
> > > I would like to use the exec task to run scp but I do not want to 
> > > type a password.  I have ssh-agent configured and it 
> works correctly 
> > > from the command line while using any ssh utility.  How can I
> > > configure the ant exec
> > > task to use the ssh-agent identity.
> > > 
> > > Thanks,
> > > -Mark
> > >  
> > >  
> > > 
> > 
> > 
> ---------------------------------------------------------------------
> > 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
> 
> ---------------------------------------------------------------------
> 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