In my Mac book pro with OS Majave, I used SSH-KEYGEN generate a new SSH key for node.js module SSH2. However, I got error message: Cannot parse privateKey: Unsupported key format
I validated the key with ssh command, it just works fine. But not with the node.js module SSH2.
In the private key file, the header is
-----BEGIN OPENSSH PRIVATE KEY-----
while the end is -----END OPENSSH PRIVATE KEY-----
.
I checked module ssh2-streams keyParser.js. The regexp pattern RE_HEADER_OPENSSH_PRIV
does not include my header. Can anyone help?
Had the same problem, found the solution here.
basically use the PEM option when you create your key: