Permission denied when I SSH access to EC2 instance

0 votes

Please help me, when I am trying to connect to my EC2 instance using SSH, I am getting a key error message. Please help me rectify it.

Permission denied (publickey)

This is the error I am getting.

Mar 12, 2019 in AWS by Ramya Mantri
2,024 views

1 answer to this question.

0 votes

These are common reasons that can cause this error are as follows:

  1. Trying to connect with the wrong key. Are you sure this instance is using this keypair?
  2. Trying to connect with the wrong username. ubuntu is the username for the ubuntu based AWS distribution, but on some others it's ec2-user (or admin on some Debians, according to Bogdan Kulbida's answer)(can also be root, fedora, see below)
  3. Trying to connect the wrong host. Is that the right host you are trying to log in to?

Note: This will also happen if you have messed up the /home/<username>/.ssh/authorized_keysfile on your EC2 instance.

answered Mar 12, 2019 by Reema

Related Questions In AWS

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

Unable to initiate ssh connection to Amazon EC2 instance

The keypair which you are using must ...READ MORE

answered Sep 5, 2018 in AWS by Archana
• 4,170 points
844 views
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer

How to make a S3 bucket public?

create a bucket policy with the following ...READ MORE

answered Mar 12, 2019 in AWS by Reena
976 views
0 votes
1 answer

How to rename files on AWS?

I have tried this and it works ...READ MORE

answered Mar 12, 2019 in AWS by Reena
1,831 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