MikiBelavista
MikiBelavista

Reputation: 2728

Why I can't connect through SSH to my EC2 instance? Permission denied

I created EC2 within my VPC that has a public subnet enter image description here I used standard security group settings

enter image description here

When I try to SSH

[email protected]: Permission denied (publickey,gssapi-keyex,gssapi-with-mic).

My route table routes(I have Internet Gateway) enter image description here

Why did I got denied permission? What should I check regarding my subnet?

Upvotes: 1

Views: 276

Answers (1)

Arpit Jain
Arpit Jain

Reputation: 1315

Change the permissions of the .pem file so only the root user can read it hope might this work in your case as most of the time we have to give permission to pem file.

sudo chmod 400 ~/.ssh/ec2private.pem

Upvotes: 1

Related Questions