Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot parse privateKey: Unsupported key format #471

Closed
robertgarrigos opened this issue Jun 7, 2019 · 7 comments · Fixed by sqlectron/sqlectron-db-core#25, #607 or #624
Closed

Cannot parse privateKey: Unsupported key format #471

robertgarrigos opened this issue Jun 7, 2019 · 7 comments · Fixed by sqlectron/sqlectron-db-core#25, #607 or #624
Assignees
Milestone

Comments

@robertgarrigos
Copy link

I cannot connect to a server thru ssh tunnel and and openssh key. Got this error:

Connection Error
Cannot parse privateKey: Unsupported key format

It's the same key I'm using to connect thru ssh to my server.

I'm on an Ubuntu 18.04.2 LTS and latest sqlectron as of today. Any ideas?

Thanks.

@btekbtek
Copy link

Ok Finally I get this to work.

What I done on my Ubuntu:

  1. I use 'wine puttygen.exe'
  2. convert my id_rsa to id_rsa.ppk
  3. this not work so I convert id_rsa.ppk to id_rsa.pem

and its connect.

@natethor
Copy link

I'm also getting this issue. I created my key normally on OSX terminal. I'd rather not have to do the work-around above using wine and puttygen. Any idea if there's plan for a fix?

@MasterOdin MasterOdin added this to the 1.32.0 milestone May 29, 2020
@MasterOdin
Copy link
Member

I've added this to the backlog for the next version.

@MasterOdin MasterOdin modified the milestones: 1.32.0, 1.33.0 Aug 29, 2020
@armarti
Copy link
Contributor

armarti commented Sep 28, 2020

Ok Finally I get this to work.

What I done on my Ubuntu:

  1. I use 'wine puttygen.exe'
  2. convert my id_rsa to id_rsa.ppk
  3. this not work so I convert id_rsa.ppk to id_rsa.pem

and its connect.

For me the command below nearly worked. Perhaps it can help someone get to the complete solution quicker.

Using puttygen-0.74 on macOS (brew install putty):

puttygen ./ssh-keygen-created.private.key -O private-openssh -o ./plain-rsa.private.key

Though it only connects successfully using this ./plain-rsa.private.key when the key is decrypted. And even then it only connects successfully when clicking the Test button while creating the connection. When I go to to actually connect to see the tables and whatnot I get the same Cannot parse privateKey: Unsupported key format. Same results with rsa2048, rsa4096, and ed25519 keys.

This puttygen makes a distinction between openssh and openssh-new formats.

$ puttygen --help
...
  -O    specify output type:
           ...
           private-openssh     export OpenSSH private key
           private-openssh-new export OpenSSH private key (force new format)
...

The "openssh" format starts with:

-----BEGIN RSA PRIVATE KEY-----

The "openssh-new" format starts with:

-----BEGIN OPENSSH PRIVATE KEY-----

@MasterOdin MasterOdin modified the milestones: 1.33.0, 1.34.0 Oct 31, 2020
@mitchbregs
Copy link

Any updates here?

@yi-mei-wang
Copy link

Facing the same issue here. Is there an update?

@maxcnunes
Copy link
Member

It got closed by mistake, we still need to update sqlectron-db-core in the app which I plan to do this weekend.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment