diff --git a/helper/communicator/sshkey/generate.go b/helper/communicator/sshkey/generate.go index 3de8ac958..51e17627a 100644 --- a/helper/communicator/sshkey/generate.go +++ b/helper/communicator/sshkey/generate.go @@ -47,11 +47,16 @@ func NewPair(public, private interface{}) (*Pair, error) { } privBlk := &pem.Block{ - Type: "", + Type: "OPENSSH PRIVATE KEY", Headers: nil, Bytes: kb, } + switch private.(type) { + case *rsa.PrivateKey: + privBlk.Type = "RSA PRIVATE KEY" + } + publicKey, err := ssh.NewPublicKey(public) if err != nil { return nil, err