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

SSH passphrase keeps saying wrong password #69

Closed
demyxco opened this issue Jun 21, 2019 · 14 comments
Closed

SSH passphrase keeps saying wrong password #69

demyxco opened this issue Jun 21, 2019 · 14 comments

Comments

@demyxco
Copy link

demyxco commented Jun 21, 2019

I decided to make a test key with the command:

ssh-keygen -t RSA

Loaded the privatekey in the form, put the correct password, and then this error keeps popping up:

Wrong password u'test' for decrypting the private key.

I noticed the "u" in the error message, is that character being added on form submission?

@huashengdun
Copy link
Owner

Make sure your passphrase is correct.
If you are using Python 2, the error message should be prefixed with the character 'u'.
The form only submits the characters you type.

@demyxco
Copy link
Author

demyxco commented Jun 24, 2019

Why was this closed? I'm still getting the error for passphrase.

[I 190624 03:00:08 handler:224] Trying RSAKey
[I 190624 03:00:08 handler:224] Trying DSSKey
[I 190624 03:00:08 handler:224] Trying ECDSAKey
[I 190624 03:00:08 handler:224] Trying Ed25519Key
[W 190624 03:00:08 web:1667] 400 POST / (172.69.142.42): Wrong password u'test' for decrypting the private key.

The passphrase works because I can connect to the remote server using an actual terminal.

bash-5.0$ ssh demyx@xxx.xxx.xxx.xxx date
Enter passphrase for key '/home/demyx/.ssh/id_rsa': 
Mon Jun 24 03:05:59 PDT 2019
bash-5.0$ 

Is this a python version issue?

@huashengdun
Copy link
Owner

No, it is not a python version issue.
I have unit tests tested against different Python versions.

As for as I know you can not generate a rsa key with a passphrase of four characters. (minimum five characters)

@demyxco
Copy link
Author

demyxco commented Jun 24, 2019

Same thing with a longer generated password

Wrong password u'1yUsVsjQH4r304' for decrypting the private key.

Any other setting I can check out?

@huashengdun huashengdun reopened this Jun 24, 2019
@huashengdun
Copy link
Owner

huashengdun commented Jun 24, 2019

I have just tested against a encrypted rsa key and it works as expected.
Did you use a correct passphrase with the right key?
If you use a fake key with a random password, it also prompts you some thing like "Wrong password...".

@demyxco
Copy link
Author

demyxco commented Jun 25, 2019

What command did you use to generate the RSA? I read somewhere that paramiko doesn’t use openssh library.

@huashengdun
Copy link
Owner

command like that

ssh-keygen -t rsa -b 2048 -f id_rsa

@demyxco
Copy link
Author

demyxco commented Jun 25, 2019

Yeah it doesn't work still, I will stick with no password keys for now. Not sure why but I will close as I don't have time to debug it. Great job on the project by the way!

@demyxco demyxco closed this as completed Jun 25, 2019
@demyxco
Copy link
Author

demyxco commented Jun 25, 2019

Hi, me again. Seems like the app doesn't like my RSA key generations so I switched to ed25519 and now the passphrase works!

@huashengdun
Copy link
Owner

tests

@huashengdun
Copy link
Owner

huashengdun commented Jun 25, 2019

I use ssh-keygen to generate all the keys:

for t in dsa rsa ecdsa ed25519; do ssh-keygen -t $t -P correctpass -f id_$t; done

From the above image, you see I tested the dsa rsa ecdsa ed25519 keys generated by ssh-keygen and they all work as expected.
So I am curious what tool did you use to generate the keys.

@demyxco
Copy link
Author

demyxco commented Jun 25, 2019

I've been using this command

ssh-keygen -t rsa

But passphrase doesn't work with your app. So now I'm using:

ssh-keygen -t ed25519

Which is supposedly better than RSA

@huashengdun
Copy link
Owner

Hi demyxco,
I have noticed that paramiko doesn't support new key format.
Maybe it is related to your problem.
Here are the links:
paramiko/paramiko#1313
#73

@demyxco
Copy link
Author

demyxco commented Jul 23, 2019

Yeah I noticed that macOS doesn't generate the old RSA keys, that's why it didn't work for me. What finally worked was using this:

ssh-keygen -m PEM -t RSA

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants