newsapps / beeswithmachineguns

A utility for arming (creating) many bees (micro EC2 instances) to attack (load test) targets (web applications).
http://apps.chicagotribune.com/
MIT License
6.43k stars 631 forks source link

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

Open sdarwin opened 10 months ago

sdarwin commented 10 months ago

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 commented 10 months ago

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 commented 3 months ago

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