ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Glenn McAllister <gl...@somanetworks.com>
Subject Re: NT => Linux : files transfer and script execution, and ssh
Date Wed, 11 Jul 2001 14:17:34 GMT
Alain RAVET wrote:

> Hi,
>
> This is about 2 basic tasks  required for development, but I don't know how
> to do them with Ant.
>
> Can, with Ant running ont my NT development workstation,
>   1° - transfer files to a remote - (secured)  - Linux server.
>   2° - launch a script on a remote - (secured) - Linux server.
>
> To do (1°), I installed samba on the - onsecured - Linux server, and mapped
> it to a drive on my NT workstation.
> This way, I can use an Ant copy task.
> This would not work if there was no Samba on the target Linux machine and/or
> the machine is secured (ssh)

For both scenarios, you can do an exec with scp and ssh...

<exec executable="scp">
  <arg value="${file.to.copy}" />
  <arg line="${remote.user}@${remote.host}:${new.filename}" />
</exec>

For this one, the password prompt worked find, but the output was swallowed.
Not sure why.

>

> To do (2°), I must manually switch to a ssh session, and type the command on
> the remote Linux machine.

<exec executable="ssh">
  <arg line="-l ${ssh.user}" />   <!-- if different from the build user... -->
  <arg value="${secure.server}" />
  <arg line="${script.name}" />
</exec>

I got prompted for a password, and it worked just fine.  The simple "ls
-al" command worked and I got the correct output.

In either case, you should be using public/private keys instead of passwords;
its much safer.

Glenn McAllister
SOMA Networks, Inc.
Mime
View raw message