AWS EC2 Error: User key not recognized by server



Error: User key not recognized by server

This error occurs when you are connecting ssh to AWS EC2 instalce Linux servers .Mostly the key you are submitting to connect your instance not recognized by server. You can get more details while you connecting to instance using ssh -vvv option

ssh -vvv -i [your key name].pem ec2-user@[public DNS address of your instance]

You will get the output like above message.

Possible reason:

Verify that your private key (.pem) file has been converted to the format recognized by PuTTY (.ppk). You can use putty generator

Verify that you are connecting with the appropriate user name for your AMI

  • For an Amazon Linux AMI, the user name is ec2-user.
  • For a RHEL AMI, the user name is ec2-user or root.
  • For an Ubuntu AMI, the user name is ubuntu or root.
  • For a Centos AMI, the user name is centos.
  • For a Fedora AMI, the user name is ec2-user.
  • For SUSE, the user name is ec2-user or root.
  • Otherwise, if ec2-user and root don’t work, check with the AMI provider.

Verify that you have an inbound security group rule to allow inbound traffic to the appropriate port


Leave a Reply