int128 / gradle-ssh-plugin

Gradle SSH Plugin
https://gradle-ssh-plugin.github.io
Apache License 2.0
319 stars 60 forks source link

Is there still support for keys with passphrase? #301

Closed jmalacrida-itexico closed 7 years ago

jmalacrida-itexico commented 7 years ago

Environment info

gradle-ssh-plugin-2.2.0 (groovy-ssh-2.2.0, jsch-0.1.52, groovy-2.4.7, java-1.8.0_25)

Steps to reproduce

  1. I run showPlatformVersion or deploy and I get this message: "reject HostKey", while the key is correct because I use it for ssh without any problem. Thank you
ssh.settings {
    dryRun = project.hasProperty('dryRun')
}

def pass = System.properties['p']

remotes {
    aws {
        host = '***********'
        port = 22
        user = 'ubuntu'
        passphrase = '************'
        identity = new File('k')
    }
}

task showPlatformVersion {
    println ssh.version
    ssh.run {
        session(remotes.aws) {
            execute 'uname -a'
            execute 'cat /etc/*-release', ignoreError: true
        }
    }
}

task deploy(dependsOn: war) {
    ssh.run {
        session(remotes.aws) {
            put from: war.archivePath.path, into: '/webapps'
            execute 'sudo service tomcat restart'
        }
    }
}
jmalacrida-itexico commented 7 years ago

Ignore the previous issue. I was doing something wrong. I can ssh properly from gradle.