gradle-ssh-plugin
gradle-ssh-plugin copied to clipboard
Auth fail when ssh-agent = true
Environment info
gradle-ssh-plugin-2.7.0 (groovy-ssh-2.7.0, jsch-0.1.53, groovy-2.4.7, java-1.8.0_77)
Steps to reproduce
- Configure remotes with SSH agent.
- Write a deploy task with an arbitrary session.
- Run deploy task.
plugins {
id 'org.hidetake.ssh' version '2.7.0'
}
remotes {
does_work {
host = 'host'
user = 'alex_ordonez'
agent = true
// passphrase = 'dontpostmeonline'
identity = file("${System.properties['user.home']}/.ssh/id_rsa")
}
does_not_work {
host = 'host'
user = 'alex_ordonez'
// agent = true
passphrase = 'dontpostmeonline'
identity = file("${System.properties['user.home']}/.ssh/id_rsa")
}
}
The output from Gradle is:
Session #2 failed: java.lang.RuntimeException: java.lang.RuntimeException: com.jcraft.jsch.JSchException: Auth fail
:deploy FAILED
FAILURE: Build failed with an exception.
* Where:
Build file '/Users/alex/projects/project/build.gradle' line: 78 // Line with ssh.run in deploy task
* What went wrong:
Execution failed for task ':deploy'.
> 1 of 2 session (50%) failed
BUILD FAILED
It does not work for me too:
serv1 {
host = '****'
user = 'root'
knownHosts = allowAnyHosts
agent = true
identity = file("${System.properties['user.home']}/.ssh/id_rsa")
}
Output:
* What went wrong:
Execution failed for task ':uploadFile'.
> Auth fail
But if I use username & plain password, it works fine.
It fails as well for me. Doing ssh directly from the command line works.
Note that this has started happening to me after Sierra OSX upgrade.
More info:
If I remove the passphrase form id_rsa, then it works just fine, BUT ONLY IF I REMOVE "agent" or I set it to "false"