diff --git a/WHATSNEW b/WHATSNEW index 61b48a441..7577745d6 100644 --- a/WHATSNEW +++ b/WHATSNEW @@ -157,9 +157,9 @@ Other changes: * The task subelement has been enhanced to allow files with tag mappings to be used. -* New task that supports file transfers over SSH. Requires - jsch, a BSD licensed SSH library that can be found at - http://www.jcraft.com/jsch/index.html +* New tasks: supports file transfers, executes a + command over SSH. They require jsch, a BSD licensed SSH library that + can be found at http://www.jcraft.com/jsch/index.html Changes from Ant 1.5.2 to Ant 1.5.3 =================================== diff --git a/docs/manual/OptionalTasks/sshexec.html b/docs/manual/OptionalTasks/sshexec.html new file mode 100644 index 000000000..b4f58d52b --- /dev/null +++ b/docs/manual/OptionalTasks/sshexec.html @@ -0,0 +1,128 @@ + + + + +SSHEXEC Task + + + + +

SSHEXEC

+

Description

+

Runs a command on a remote machine running SSH daemon. +

+ +

Note: This task depends on external libraries not included +in the Ant distribution. See Library Dependencies +for more information. This task has been tested with jsch-0.1.2.

+ +

Parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeDescriptionRequired
usernameThe username on the remote host to which you are connecting.Yes
commandThe command to run on the remote host.Yes
portThe port to connect to on the remote host.No, defaults to 22.
trustThis trusts all unknown hosts if set to yes/true.No, defaults to No.
knownhostsThis 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.No, defaults to + ${user.home}/.ssh/known_hosts.
failonerrorLog a warning message, but do not stop the build, + when the transfer does not work. + No; defaults to true.
passwordThe password.Not if you are using key based + authentication or the password has been given in the file or + todir attribute.
keyfileLocation of the file holding the private key.Yes, if you are using key based + authentication.
passphrasePassphrase for your private key.No, defaults to an empty string.
+ +

Examples

+

Run a command on a remote machine using password authentication

+
+  <sshexec host="somehost"
+	username="dude"
+	password="yo"
+	command="touch somefile"/>
+
+ +

Run a command on a remote machine using key authentication

+
+  <sshexec host="somehost"
+	username="dude"
+	keyfile="${user.home}/.ssh/id_dsa"
+	passphrase="yo its a secret"
+	command="touch somefile"/>
+
+ +

Run a command on a remote machine using key authentication with no passphrase

+
+  <sshexec host="somehost"
+	username="dude"
+	keyfile="${user.home}/.ssh/id_dsa"
+	command="touch somefile"/>
+
+ +

Security Note: Hard coding passwords and/or usernames +in sshexec task can be a serious security hole. Consider using variable +substituion and include the password on the command line. For example:
+

+  <sshexec host="somehost"
+	username="${username}"
+	password="${password}"
+	command="touch somefile"/>
+
+Invoke ant with the following command line: +
+    ant -Dusername=me -Dpassword=mypassword target1 target2
+
+

+ +

Copyright © 2003 Apache Software Foundation. +All rights Reserved.

+ + + + diff --git a/docs/manual/install.html b/docs/manual/install.html index 5f15ad2f9..d0366d98d 100644 --- a/docs/manual/install.html +++ b/docs/manual/install.html @@ -420,7 +420,7 @@ Installing Ant / Optional Tasks section above.

jsch.jar - scp task + sshexec and scp tasks http://www.jcraft.com/jsch/index.html diff --git a/docs/manual/optionaltasklist.html b/docs/manual/optionaltasklist.html index fd4a739ea..1d1e59605 100644 --- a/docs/manual/optionaltasklist.html +++ b/docs/manual/optionaltasklist.html @@ -60,6 +60,7 @@ Sound
SourceOffSite
Splash
+Sshexec
Starteam Tasks
Stylebook
Symlink