Browse Source

SSH keyfiles can be password-less. PR 33718.

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@677532 13f79535-47bb-0310-9956-ffa450edef68
master
Stefan Bodewig 17 years ago
parent
commit
7d8e56b37a
3 changed files with 8 additions and 5 deletions
  1. +4
    -0
      WHATSNEW
  2. +1
    -2
      docs/manual/OptionalTasks/scp.html
  3. +3
    -3
      src/main/org/apache/tools/ant/taskdefs/optional/ssh/Scp.java

+ 4
- 0
WHATSNEW View File

@@ -203,6 +203,10 @@ Other changes:

* <sql> "output" attribute now supports any Resource in addition to a file.

* <scp> no longer requires a passphrase when using key based
authentication.
Bugzilla report 33718.

Changes from Ant 1.7.0 TO Ant 1.7.1
=============================================



+ 1
- 2
docs/manual/OptionalTasks/scp.html View File

@@ -156,8 +156,7 @@ for more information. This task has been tested with jsch-0.1.2 and later.</p>
<tr>
<td valign="top">passphrase</td>
<td valign="top">Passphrase for your private key.</td>
<td valign="top" align="center">Yes, if you are using key based
authentication.</td>
<td valign="top" align="center">No, defaults to an empty string.</td>
</tr>
<tr>
<td valign="top">verbose</td>


+ 3
- 3
src/main/org/apache/tools/ant/taskdefs/optional/ssh/Scp.java View File

@@ -353,15 +353,15 @@ public class Scp extends SSHBase {
setUsername(uri.substring(0, indexOfColon));
setPassword(uri.substring(indexOfColon + 1, indexOfAt));
} else if (indexOfAt > -1) {
// no password, will require passphrase
// no password, will require keyfile
setUsername(uri.substring(0, indexOfAt));
} else {
throw new BuildException("no username was given. Can't authenticate.");
}

if (getUserInfo().getPassword() == null
&& getUserInfo().getPassphrase() == null) {
throw new BuildException("neither password nor passphrase for user "
&& getUserInfo().getKeyfile() == null) {
throw new BuildException("neither password nor keyfile for user "
+ getUserInfo().getName() + " has been "
+ "given. Can't authenticate.");
}


Loading…
Cancel
Save