Create new key pair
Key pair (login)
My-First-Key-Pair
Create security group
Firewall (security groups)
My IP
Allow SSH traffic from
My-First-Ec2-Instance
Amazon Linux 2023 AMI
Amazon Machine Image (AMI)
Keep rest of the values as default and click "Launch Instance".
chmod 400 My-First-Key-Pair.pem
Change Key Pair Permission
ssh -i "My-First-Key-Pair.pem" ec2-user@ec2-107-21-196-173.compute-1.amazonaws.com
Select the Instance and Click "Connect".
Click SSH Client Tab and Copy Paste the connect string.
Copy Paste the Region: 18.206.107.24/29 into the Security Group
Open the Security Groups in a New Tab.
Update the Inbound Rule by clicking "Edit Inbound Rules".
Add the SSH Rule as below:
Click "Save Rules".
Now you should be able to connect to your EC2 Instance via "EC2 Instance Connect".
Select "My-First-Ec2-Instance" and Click "Terminate (delete) instance"
Delete the Key Pair "My-First-Key-Pair".
Delete the Security Group "launch-wizard-x".