gradle-ssh-plugin icon indicating copy to clipboard operation
gradle-ssh-plugin copied to clipboard

Support for .pem identity type

Open willis7 opened this issue 8 years ago • 5 comments

Amazon EC2 instances use .pem files as the identity. I am getting a reject HostKey: error when trying to use that type of file.

remotes {
    sandbox {
        host = 'ec2-XX-XXX-XXX-XX.eu-west-1.compute.amazonaws.com'
        user = 'ec2-user'
        identity = file("${System.properties['user.home']}/.ssh/devtools.pem")
    }
}

Am I using it incorrectly or is this type not supported. I am trying to replicate: ssh -i ~/.ssh/devtools.pem [email protected]

willis7 avatar Jun 08 '16 11:06 willis7

Would you check if ~/.ssh/known_hosts contains the host key of EC2 instance? reject HostKey: means host key, not user key.

int128 avatar Jun 09 '16 01:06 int128

I can see both the public ip and public dns, however I notice they have the encryption type ecdsa-sha2-nistp256 whereas the rest have ssh-rsa.

willis7 avatar Jun 09 '16 08:06 willis7

Any updates? The plugin supports both RSA and ECDSA type of host key.

int128 avatar Jun 30 '16 10:06 int128

I couldn't get it to work unfortunately

willis7 avatar Jun 30 '16 15:06 willis7

Now the plugin supports the feature to automatically add a host key to known_hosts. Please try knownHosts = addHostKey(file(...)).

int128 avatar Sep 06 '16 13:09 int128