-
Notifications
You must be signed in to change notification settings - Fork 665
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 Private Keys from PuttyGen? #191
Comments
You want it to start like this:
Using PuTTYgen, load the existing key, and then select Conversions -> Export OpenSSH key. This file should work fine. You'll want this version for other tools as well. That being said, supporting PuTTY style keys might be a useful feature request for some, I suppose. In fact, there's a TODO for it. -[Unknown] |
FWIW PPKs are now supported in the rewrite branch. |
I am attempting to write a Restful style File Service that allows you to grab files from servers. I am getting the following error: ERROR::Error: All configured authentication methods failed. I use the same exact .ppk file that I use for putty and that works. this is my code for making the connection:
|
@btz1211 You should be using |
@mscdex, thank you for replying so promptly. I've updated my code to use 'privateKey' instead: this.client.connect({ now I am getting: Error: Malformed private key (expected sequence) at genPublicKey |
@btz1211 Is your key encrypted? Either way, are you able to generate a new and unused PPK that reproduces the same error? |
My key is not encrypted. Just used PuttyGen to generate another private key. I got the same error. This is what my ppk file look like: PuTTY-User-Key-File-2: ssh-rsa |
Can you provide the actual literal file contents somewhere? I'd like to add it as a test so I can duplicate it on my end as well. |
@mscdex , sure. Here is the full file content: PuTTY-User-Key-File-2: ssh-rsa Just a quick question, I see in the genPublicKey method your first check is: if (privKey[0] === 0x30) Why is that? I think that's the issue here. My file starts with 'A' |
I am still getting the same error: Error: Malformed private key (expected sequence) at genPublicKey (E:\NodeJS\NodeJS-SSH-Service\node_modules\ssh2\node_modules\ssh2-streams\lib\utils.js:307:13) at Client.connect |
+1 getting this too =[
|
Ganna, |
@ganna-shmatova @btz1211 What version of PuTTYGen did you use to create those keys? I get a MAC error when trying to load either of your keys (via PuTTYGen). |
@mscdex it was generated with 0.9.52 beta filezilla |
@ganna-shmatova How did you generate a PPK with FileZilla? |
@mscdex Open FileZilla server, connect, |
@ganna-shmatova That's not for generating PuTTY keys, that's for generating a TLS certificate (for the server). Those are two different things. As far as I know the only way to generate PuTTY keys is to use PuTTYGen, which can save out to the |
@btz1211 that worked like a charm! |
Are the private keys generated from PuttyGen not compatible with ssh2?
http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html
The private keys that are generated (SSH-2 RSA) look like this:
I get this error message:
The text was updated successfully, but these errors were encountered: