question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot parse privateKey: Unsupported key format

See original GitHub issue

I 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:closed
  • Created 5 years ago
  • Reactions:13
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
mscdexcommented, Apr 25, 2019

Full Ed25519 support now available in ssh2-streams v0.4.3 when used with node v12.0.0.

0reactions
mscdexcommented, Jan 6, 2019

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

node.js - 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,...
Read more >
Cannot parse privateKey: Unsupported key format #85 - GitHub
Error while connecting to SSH FS my_prg: Cannot parse privateKey: Unsupported key format I am on macbook pro, the key is a regular...
Read more >
Verify the SSH service connection details. Error
Verify the SSH service connection details. Error: Error: Cannot parse privateKey: Unsupported key format.
Read more >
How could I connect by ssh node to my server? - n8n community
I tried to connect by “ssh node” to my google compute with private key, but it failed by this error: ERROR: Cannot parse...
Read more >
SSH Public key authentication "Cannt parse private key ...
Hello Guys, I'm trying to set up a public key authentication on some cisco devices. ... "Cannt parse private key : Unsupported key...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found