Host key not found in directory Permission denied publickey or Authentication failed permission denied

0 votes

Hi Everyone,

I have my instances in AWS. I downloaded private key to connect my instances. But I got this error, when I tried to connect my instance from my local system.

Host key not found in [directory], Permission denied (publickey), or Authentication failed, permission denied

How can I solve this error?

Apr 28, 2020 in AWS by akhtar
• 38,260 points
935 views

1 answer to this question.

0 votes

Hi@akhtar,

When we connect our instance from local machine via SSH, we have to provide .pem file and also the user name. But user name depends on your AMI. So make sure you are using proper user name at the time of SSH. You can go through the below points.

  • For Amazon Linux 2 or the Amazon Linux AMI, the user name is ec2-user.

  • For a CentOS AMI, the user name is centos.

  • For a Debian AMI, the user name is admin or root.

  • For a Fedora AMI, the user name is ec2-user or fedora.

  • For a RHEL AMI, the user name is ec2-user or root.

  • For a SUSE AMI, the user name is ec2-user or root.

  • For an Ubuntu AMI, the user name is ubuntu.

  • Otherwise, if ec2-user and root don't work, check with the AMI provider.

answered Apr 28, 2020 by MD
• 95,460 points

Related Questions In AWS

0 votes
1 answer
0 votes
1 answer
0 votes
1 answer

if instance is a part of some AutoScaling Group in AWS or not ?

You can run this command below on ...READ MORE

answered Jun 2, 2018 in AWS by Cloud gunner
• 4,670 points
1,724 views
0 votes
1 answer
0 votes
1 answer

bad permissions: ignore key: .ssh/my_private_key.pem Permission denied (publickey).

Hi@akhtar, In your error message it shows you ...READ MORE

answered Apr 28, 2020 in AWS by MD
• 95,460 points
10,813 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP