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 in AWS by akhtar
• 11,270 points
25 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 by MD
• 24,500 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 1, 2018 in AWS by Cloud gunner
• 4,630 points
132 views
0 votes
1 answer
0 votes
1 answer