From 65190d753db9ed4e1953cf506c2f8cf6392d9f9e Mon Sep 17 00:00:00 2001
From: Steve Loughran since Ant 1.6 Copies a file or FileSet to or from a remote machine running SSH daemon.
+ Copies a file or FileSet to or from a (remote) machine running an SSH daemon.
FileSet only works for copying files from the local machine to a
remote machine.
Security Note: Hard coding passwords and/or usernames
in scp task can be a serious security hole. Consider using variable
-substitution and include the password on the command line. For example:
+substitution and include the password on the command line. For example:
+
<scp todir="${username}:${password}@host:/dir" ...>-Invoke ant with the following command line: +Invoking ant with the following command line:
ant -Dusername=me -Dpassword=mypassword target1 target2- + +Is slightly better, but the username/password is exposed to all users on an Unix +system (via the ps command). The best approach is to use the +
<input>
task and/or retrieve the password from a (secured)
+.properties file.
+
+
Unix Note: File permissions are not retained when files
are copied; they end up with the default UMASK
permissions