Cannot parse privateKey: Unsupported key format
See original GitHub issueI recently updated my RSA public/private key to use the OpenSSH key format, the file now begins with:
-----BEGIN OPENSSH PRIVATE KEY-----
But while I don’t have any problem with other programs, ftp-remote-edit (a package for the Atom text editor: https://github.com/h3imdall/ftp-remote-edit) is the only software that has an issue and is giving me the error:
Cannot parse privateKey: Unsupported key format
I dived into the matter and found out the error was thrown by ssh2-stream’s keyParser module. Rather logical when reading the script, the header of my keyfile does not match any of the regular expressions.
To convert my key to the OpenSSH format I used:
ssh-keygen -f id_rsa -o -p -a 100
Converting it back to the old format can be done with:
ssh-keygen -f id_rsa -p -a 100
Which does indeed solve the issue, but the only problem is this will not work for my ED25519 keypairs since they only accept OpenSSH formatting.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:13
- Comments:5 (4 by maintainers)
Full Ed25519 support now available in
ssh2-streams
v0.4.3 when used with node v12.0.0.FWIW
ssh2-streams
v0.3.0 now supports the “new” OpenSSH key format, but not ed25519 keys yet as that requires OpenSSL 1.1.1 which has not yet been incorporated into node core.