12

I am unable to connect to EC2 (CentOs) from my MacBook. When I connect it from ubuntu machine, it will be connected. Currently, I got the following the following error:

ec2 ssh sign_and_send_pubkey: no mutual signature supported Account locked due to 290 failed logins

How can I solve the problem?

I have tried the following command:

ssh -i key.pem ec2-user@ip
halfer
  • 19,824
  • 17
  • 99
  • 186
Deependra Dangal
  • 1,145
  • 1
  • 13
  • 36
  • This isn’t related to EC2 or AWS in general. It is definitely related to macOS and openSSH. You should post this question to relevant area. – Pacifist Aug 22 '19 at 07:15
  • You can check https://cmsgraham.wordpress.com/2018/11/14/macos-mojave-iterm2-3-2-5-ssh-error-after-upgrade-sign_and_send_pubkey-no-mutual-signature-supported/ – Rafaf Tahsin Aug 22 '19 at 08:16

2 Answers2

27

I was locked out and couldn't access the machine to enter in the suggested answer's change to ssh config.

I added the following argument to the ssh call -o PubkeyAcceptedKeyTypes=+ssh-rsa and it worked.

Example:

ssh -i "keypair.cer" -o PubkeyAcceptedKeyTypes=+ssh-rsa ec2-user@ip

Note: the ssh call will accept both .cer and .pem filetypes.

Kyle Venn
  • 4,597
  • 27
  • 41
  • 2
    this worked for me, but what I don't understand is what changed in either my server or my client, I haven't used these parameters before. And btw I can't connect through the web browser feature anymore as well. – Fabio Jan 20 '23 at 08:20
  • @Fabio same thing happened to me! Took me forever to find this. I think Amazon changed how EC2 works. – Kyle Venn Jan 20 '23 at 18:33
  • Could be, but I'd like to clarify that I'm sure these changes did NOT happen on my live instance since I had no automatic or manual updates since I last logged in. I also re-started an instance I had down since 2016~ish and faced same problem. – Fabio Jan 26 '23 at 10:43
17

edit or create the file ~/.ssh/config and add the following content:

Host *
  PubkeyAcceptedKeyTypes=+ssh-dss

After that, try again.

Alejandro
  • 766
  • 9
  • 24