A new subnet's instances cannot be reached via SSH from the internet. Walk through the checks.
BeginnerScenarioVPC and Networking
Answer
Situation read → Connectivity needs an IGW route, a public IP, an SG rule and a NACL that allows it.
What I'd do →
- Subnet route table has
0.0.0.0/0 -> igw-... - Instance has a public or Elastic IP
- SG allows TCP 22 from your IP
- NACL allows inbound 22 and outbound ephemeral ports
- Better, remove public SSH entirely and use SSM Session Manager:
aws ssm start-session --target i-0abc
Why → Each layer can independently block; checking in packet order finds the break quickly.
Interview tip → Suggest Session Manager as the modern replacement.
More on VPC and Networking
What is a VPC and what are the CIDR constraints?BeginnerWhat makes a subnet public or private?BeginnerHow do route tables work, including the local route and longest-prefix match?IntermediateInternet Gateway vs NAT Gateway: what does each do?BeginnerNAT Gateway vs NAT instance?IntermediateSecurity group vs network ACL: compare them.Beginner