I cannot connect to the SSH host using the Gradle SSH Plugin with my private key.
Specifying a password in build.gradle
works fine:
remotes {
webServer {
host = '<IP>'
user = '<USER>'
password = '<PASSWORD>'
}
}
But in order not to write my password in the build file, I found that my environment connects using my private key without entering the password from the shell:
ssh <user>@<ip>
This command works from the shell, but I cannot achieve this with the Gradle plugin. This is my configuration:
remotes {
webServer {
host = '<IP>'
user = '<USER>'
identity = file("${System.getProperty('user.home')}/.ssh/id_rsa")
}
}
Mistake:
Called: com.jcraft.jsch.JSchException: USERAUTH does not work in com.jcraft.jsch.UserAuthPublicKey.start (UserAuthPublicKey.java:119)
So how can I connect from the shell, what happened to my configuration?