-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
paramiko.ssh_exception.SSHException: encountered RSA key, expected OPENSSH key #1612
Comments
That is a misleading exception, due to this logic in the client: https://github.com/paramiko/paramiko/blob/2.7.1/paramiko/client.py#L674 It tries to load the keyfile with each key type, and if there is some error/exception it continues on to the next key type, but it also saves the last exception encountered. So loading your RSA key as an You can try running I also notice that the version of cryptography installed is different, you could try getting both windows and linux on the same version of cryptography, just as an experiment to narrow-down the issue. |
I see this exception when the public key not in the server user's authorized keys (so login failed), it's a very misleading exception. |
It can also happen if the key has a passphrase set and the phrase is not in your ssh-agent. Very misleading indeed ;-) |
I happens also simply if you have an authentication error. So yeah, very misleading. |
I hit this today, and yeah, it's irritating. I wonder if we can fix this by being careful in client.py about not necessarily setting saved_exception to the last exception it hit. To be honest, what is really required is adding much more granular Exception classes. Or perhaps some way to compare exceptions for their relative importance. |
I got this error with Ubuntu14 on AWS (kernel: 3.13.0-74-generic) |
While using rsa key in pem format, ssh hook/paramiko seem to expect ed25519 type of key as highlighted. rsa keys were working fine earlier and started having issue from last few months. Is there something recently changed? I am using version SSH-2.0-paramiko_2.9.1 Traceback (most recent call last): |
I tested this and this behaviour was introduced in paramiko 2.9.0. A key that works fine on 2.8.1 fails on 2.9.0. |
I'm running into the same issue. I can confirm that it worked with 2.8.1 but started failing when upgrading to 2.9.0 |
Those of you having "this error" on 2.9 in particular, are likely hitting issues with RSA2 key handshaking and then (as noted by other commenters) encountering the overall problem of #387 re: the auth logic presenting misleading final errors. If you haven't yet, please check the changelog re: the possible need to supply |
SSHException('encountered EC key, expected OPENSSH key') |
I'm getting the same (encountered RSA key, expected OPENSSH key) error while creating and testing SSH/SFTP connection profile to AIX server from Airflow web portal. |
Hi, I just hit the error
Could the source code be enhanced to be more verbose when it hits this error? If the answer is that it "seems to expect ed25519 type key", it could probably say that more clearly, about how RSA is deprecated. This is just very terse. "encountered RSA key, expected OPENSSH key". |
@ranjithreddyn9, @sdarwin -- this ticket is closed. Please make sure you have tried the solution indicated by bitprophet. If that still doesn't work for you, please open new support tickets and include a reference back to this issue. Thanks! |
Providing key file name to client.connect
Key file starts with -----BEGIN RSA PRIVATE KEY----- and end with -----END RSA PRIVATE KEY-----
Code works fine under linux but on windows I get:
paramiko.ssh_exception.SSHException: encountered RSA key, expected OPENSSH key
python3.8 on windows. python3.6 on linux.
Windows deps:
paramiko==2.7.1
Linux deps:
paramiko==2.7.1
The text was updated successfully, but these errors were encountered: