When I try to execute the deploy task, the executeSudo method doesn't prompt for sudo password. I have tried using other solutions for getting the sudo password from the user described in #302 and #16. When I run the task I get the error org.hidetake.groovy.ssh.interaction.InteractionException: Error while stream interaction: org.hidetake.groovy.ssh.session.execution.SudoException: Failed sudo authentication on jsonet[jsonet.ddns.net:22]: Sorry, try again.
The task works fine when I set the sudoPassword in plain text but I would really like to avoid storing the sudo password in plain text somewhere.
task deploy(dependsOn: distTar) {
description = 'Uploads the server distribution to the remote app server.'
group = 'distribution'
doLast {
ssh.run {
session(remotes.role('appServer')) {
def targetFile = "${applicationName}-${version}.tar"
put from: new File(new File(buildDir, "distributions"), targetFile),
into: "/tmp"
executeSudo "mv /tmp/$targetFile /opt", pty: true
}
}
}
}
Environment info
gradle-ssh-plugin-2.9.0 (groovy-ssh-2.9.0, jsch-0.1.53, groovy-2.4.12, java-1.8.0_144)
Description
When I try to execute the deploy task, the
executeSudo
method doesn't prompt for sudo password. I have tried using other solutions for getting the sudo password from the user described in #302 and #16. When I run the task I get the errororg.hidetake.groovy.ssh.interaction.InteractionException: Error while stream interaction: org.hidetake.groovy.ssh.session.execution.SudoException: Failed sudo authentication on jsonet[jsonet.ddns.net:22]: Sorry, try again.
The task works fine when I set the
sudoPassword
in plain text but I would really like to avoid storing the sudo password in plain text somewhere.