Day 37: Issue with Managing EC2 Access with S3 Role-based Permissions

rob_kodekloud
Sat, 18 Apr 2026 21:07:39 +0000

TBH, I just don’t know why you’re failing here. I just did the following:

Created a public key pair (ssh-keygen with no arguments) in the terminal.

Logged into the AWS console.

Opened the EC2 “instances” list, and chose “Connect” for the existing instance.

Chose “EC2 Connect” with straight out defaults; EC2 connect worked.

Using the open “ec2-connect” terminal, edited ~/.ssh/authorized_keys to contain the id_rsa.pub file from the lab terminal.

Chose the security tab from the instance display for the EC2 instance, and chose the security group of the instance.

Edited incoming, and added ssh for 0.0.0.0.

Went back to the Connect screen, choose “ssh client”

Copied the ssh connect string.

Edited the string so the -i argument points to ~/.ssh/id_rsa.

Executed the command, got the ubuntu account for the instance.

Please read this AWS doc page, to make sure you’re doing what I suggest above.