AWS Compare 高频对比

EC2 Initialization, Connection, and Permission Errors

EC2 Initialization Connection and Permission Errors

compareEC2troubleshootingIAM
Last organized

Troubleshoot EC2 by separating initialization, network reachability, OS login, and AWS API authorization.

Separate the control paths

Most EC2 failures belong to one of four paths: boot initialization, network reachability, OS login, or AWS API authorization. Identify the layer before changing controls.

SymptomMeaningCheck first
Application was not deployedUser data or bootstrapping failedcloud-init logs, script, DNS, egress, package source
Connection timeoutNo usable network responseaddress, route, IGW, NACL, SG, corporate firewall
Connection refusedThe host was reached, but the port rejected the connectionsshd/application listener, host firewall
Permission deniedSSH was reached, but authentication failedprivate key, OS username, authorized_keys
Unable to locate credentialsSDK/CLI found no credentialsinstance profile, IMDS, provider chain
AccessDeniedAn identity exists but lacks authorizationaction, resource, condition, explicit deny, SCP, boundary

Connection boundaries

  • EC2 Instance Connect still uses SSH and needs IAM, the correct OS user, EIC support, and a network path.
  • Session Manager uses the SSM agent and outbound channels, so inbound port 22 is unnecessary.
  • OS access and AWS API access are separate; the EC2 IAM role controls application permissions.
  • EC2 receives temporary role credentials through an instance profile; do not store a human’s long-term access key.

Troubleshooting order

Address and DNS → route/IGW/NAT → NACL → security group → host firewall → service listener → OS authentication → IAM authorization.

Remember

Timeout means path, refused means service, permission denied means SSH identity, and AccessDenied means IAM authorization.