Skip to content

Instantly share code, notes, and snippets.

@wilmoore
Last active October 16, 2024 20:34
Show Gist options
  • Select an option

  • Save wilmoore/564492065012ab50231e6efbd3c621ea to your computer and use it in GitHub Desktop.

Select an option

Save wilmoore/564492065012ab50231e6efbd3c621ea to your computer and use it in GitHub Desktop.
Software Engineering :: Cloud :: AWS :: AWS SSH :: Training :: I have Asked This SSH Question in Every AWS Interview — And Here’s the Catch

Software Engineering :: Cloud :: AWS :: AWS SSH :: Training :: I have Asked This SSH Question in Every AWS Interview — And Here’s the Catch

⪼ Made with 💜 by Polyglot.

content

“You're attempting to SSH into an EC2 instance, the credentials are correct, but, the connection continues to fail.”

  1. Security Groups: Ensure that port 22 (SSH) is open to your IP address or a range of addresses in the security group associated with your instance.
  2. Key Pair Permissions: The private key file you use for SSH must have proper permissions. Specifically, it should have chmod 400 or stricter permissions (otherwise SSH will reject it).
  3. Confirm the Instance is Running: Verify that the EC2 instance is in a running state and not stopped, terminated, or otherwise unavailable.
  4. Network ACLs and Route Tables: Check that the Network ACLs and route tables allow inbound and outbound traffic to/from your instance. Misconfigured network settings could prevent SSH access even if the security group is correct.
  5. EC2 Instance Connect: If you are using EC2 Instance Connect, make sure the service is properly set up, and that the instance supports it (this is an alternative method of connecting via SSH).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment