EC2 connectivity path
Follow client, DNS, public/private routing, security group, network ACL and host listener in order. A timeout differs from connection refused; preserve the actual symptom before changing controls. Connection refused usually means an address was reached but no usable listener accepted the connection; timeout leaves routing, filtering and host reachability open. Permission denied points later toward SSH authorization.
Connection refused usually means an address was reached but no usable listener accepted the connection; timeout leaves routing, filtering and host reachability open. Permission denied points later toward SSH authorization.
A route selects a network path; a security group controls permitted traffic at the relevant interface; a listener is a process accepting connections on a port. Imagine an SSH connection works from one subnet but times out from another. Compare source path and controls before changing the host configuration. Check the instance address and whether the intended route exists, then evaluate interface and subnet filtering and the host listener. Network ACLs and security groups have different semantics, so do not assume changing one automatically fixes the other. Read the exact client symptom and preserve timestamps. Broad inbound access may make a test succeed but creates unnecessary exposure and conceals the failed boundary. Identify the smallest supported correction and verify from the originally failing source, not only from an administrator's laptop.
Permission denied points later toward SSH authorization.
A timeout and permission-denied response prove the same failure layer.