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

paramiko.ssh_exception.SSHException: encountered RSA key, expected OPENSSH key #236

Open
sdarwin opened this issue Nov 7, 2023 · 2 comments

Comments

@sdarwin
Copy link

sdarwin commented Nov 7, 2023

Ubuntu 22.04 , Python 3.10

Per issue 235, I upgraded paramiko:

paramiko     3.3.1

(that version of paramiko might or might not be connected to the problem.)

bees up worked. Now at bees attack it shows

paramiko.ssh_exception.SSHException: encountered RSA key, expected OPENSSH key

The key is located in /root/.ssh/mykey.pem

-----BEGIN RSA PRIVATE KEY-----
MIIEpQIBAAKCAQEAjTPorngh1kjfjBvK5XkN5zuCbPwhB73Toz2aGvK++x9Ev4it
...
...
-----END RSA PRIVATE KEY-----

Permissions are:

ls -al /root/.ssh
total 20
drwx------ 2 root root 4096 Nov  7 20:56 .
drwx------ 1 root root 4096 Nov  7 20:55 ..
-rw------- 1 root root 1956 Nov  7 20:56 known_hosts
-rw------- 1 root root 1679 Nov  7 20:10 mykey.pem

If I manually use the key to ssh to a bee, that is alright:

ssh -i /root/.ssh/mykey.pem ubuntu@IP

Any ideas about this particular error?

paramiko.ssh_exception.SSHException: encountered RSA key, expected OPENSSH key

@sdarwin
Copy link
Author

sdarwin commented Nov 9, 2023

paramiko 3.3.1
Ubuntu 22.04, Python 3.10

In AWS, create another keypair. Switch from RSA to ED25519. Retry bees attack.

Different error this time. Instead of "expected OPENSSH key",

paramiko.ssh_exception.AuthenticationException: Authentication failed.

@AndriiSvit
Copy link

I have the same issue on production. I don't know how to solve it for at least two months

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