githubEdit

EC2

Connect to instances

Methods to connect

Method
Requires Direct Network Access
Requires Agent
Requires EC2 IAM Permissions

Direct SSH/RDP

YES

NO

NO

EC2 Instance Connect

YES

YES (Installed on Amazon Linux 2)

NO

SSM Run Command

NO

YES

YES

SSM Session Manager

NO

YES

YES

EC2 Serial Console

NO

NO, but users must have a password set

NO

1) In AWS Console, go to:

Ec2 Instance Connect

EC2 -> Instance ID -> Connect -> EC2 Instance Connect -> Chose Public OR Private IP -> Connect

SSM Session Manager

EC2 -> Instance ID -> SSM Session Manager -> Connect

Instance Metadata Service (IMDS)

IMDSv1

1) Get the role name (EC2 Instance Shell)

2) Ask for session credentials

IMDSv2

1) Enable IMDSv2

Get the instance ID

Update the instance metadata options to require a token to make the instance metadata call

2) Get the HTTP Token

3) Get credentials

EC2 Networking

1) Look for network information

AWS CLI or CloudShell: https://console.aws.amazon.com/cloudshell/home?region=us-east-1

EC2 Storage

1) Check information on a snapshot

AWS CLI or CloudShell

2) Get the availability zone

EC2 Instance Console

3) Create a volume from the snapshot

EC2 Instance Console

4) Attach the volume to our instance

EC2 Instance Console

5) Check the existance of the volume

EC2 Instance Console

6) Create a mount point, mount the disk and view contents

EC2 Configuration

UserData file

EC2 Instance Console

1) Read the data from the UserData file

OR

Last updated