AWS EC2 – How to Fix Security Group to Allow Specific IP Address

amazon ec2amazon-web-servicesputty

I can connect to AWS EC2 Instance using PuTTY at my home by laptop. But when I bring the laptop to some cafe that provides free Wifi, it ends up with timeout error.

In order to solve this problem, I need to fix the security group attached to the EC2 instance to allow the connection from the cafe’s public IP.

Here is what I've done.

1.Log into AWS ec2

  1. Search for "VPC" in the search bar at the top

  2. Click on VPC

  3. Click on "security groups" on the left

After that, I have no idea what should I do.
I guess I should register Cafe's IP address to security groups but I don't know
how to do…

Please advise me next step.

Best Answer

When you are at a Cafe and use public wifi, i suggest to use this site to get your correct public IP address.

https://showip.net/

From your Security Group, please follow the below steps:

  1. Edit Inbound rule
  2. Add an ingress rule with SSH/22 and input your /32 (Remember to use /32)
  3. Click "Save"

Reference: https://docs.aws.amazon.com/vpc/latest/userguide/VPC_SecurityGroups.html

At step 2, you can use a button named "My IP" which AWS automatically loads your public IP address.

Related Topic