简体   繁体   中英

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

I created EC2 within my VPC that has a public subnet 在此处输入图片说明 I used standard security group settings

在此处输入图片说明

When I try to SSH

ec2_user@3.123.36.129: Permission denied (publickey,gssapi-keyex,gssapi-with-mic).

My route table routes(I have Internet Gateway) 在此处输入图片说明

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

更改 .pem 文件的权限,以便只有 root 用户可以读取它,希望这可能适用于您的情况,因为大多数情况下我们必须授予 pem 文件的权限。

sudo chmod 400 ~/.ssh/ec2private.pem

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM