0

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

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

3.Click on VPC

4.Click on "security groups" on the left

5.Edit Inbound rule

6.Add an ingress rule with SSH/22 and input Cafe's IP with /32

Here is image of settings.

enter image description here

But still can not connect to EC2. What should I see next?

  • There are many things that can cause problems here. Routing, Security Groups, NACLs, IPtables, the cafe's firewall. I would always start with a diagram of the links in the chain (you -> router -> internet -> VPC -> EC2 for instance), and check each bit. Debugging these issues is a case of being thorough and methodical. – shearn89 Mar 14 '22 at 10:07
  • Do you have any logs you can provide us? – shearn89 Mar 14 '22 at 10:08

1 Answers1

0

Your SG looks ok. It's pretty common for cafes and such to block everything other than http(s). To use ssh in that case you would need a VPN that works over https to use as a proxy to access ssh.

A better option is to use Systems Manager Session Manager. You log into the AWS console EC2 area then get an SSH terminal from there into your instance. This relies on a specific agent being installed on your instance, but many AWS AMIs have it installed by default. You also need to do a bit of configuration to get Session Manager working, it can be a bit fiddly but it's well documented by AWS.

Tim
  • 31,888
  • 7
  • 52
  • 78