0

I can't connect to my AWS EC2 Ubuntu instance. I appear to have the address and user right, the security group allows connections on all ports, and I'm using the right key pair. SSH and telnet keep timing out, though. I don't know what I'm doing wrong. Suggestions? I'm quite new to AWS.

Dylan Knowles
  • 147
  • 1
  • 3
  • 9
  • Without more details (security group configuration details/screenshot, instance configuration details/screenshot specifying the security group selected, and the exact command that you're using to connect), all we can do is speculate. – Skyhawk Jul 31 '14 at 18:21
  • When you look at the instance in the AWS console, make sure the right security groups are listed, the instance is up, and make sure you're using the correct public IP. Also, make sure that the security group is allowing connections on all ports for either the IP you're connecting from or from all IP's (set the source to 'Anywhere' in the security group rule). We'll need more specifics if you're still having problems. – Bruce P Jul 31 '14 at 18:24
  • I figured as much, but as I'm new I'm not sure what's safe to share and what isn't. Suggestions? – Dylan Knowles Jul 31 '14 at 18:24
  • @BruceP: As far as I know, I have all of the things you've mentioned correct. How do I set the source to "Anywhere", just to be sure I've got it right? – Dylan Knowles Jul 31 '14 at 18:25
  • Edit the security group. Click on the "Source" button. It should have 3 options: "Anywhere", "My IP", or "Custom IP". – Bruce P Jul 31 '14 at 18:27
  • That was it, thanks @BruceP! I didn't notice that field, it would seem. Add your answer and I'll mark it as solved. :) – Dylan Knowles Jul 31 '14 at 18:32

1 Answers1

2

Make sure your security groups are fully set up properly.

Each rule in a security group consists of 3 parts

  • the protocol (TCP,UDP,etc),
  • the port range,
  • and the source IP address.

Protocol / Range

The first two can also be set via common protocols (SSH, SMTP, etc).

IP Address

There are three options for the IP address:

  • "Anywhere",
  • "My IP",
  • and "Custom IP".

The IP ranges are all in CIDR format, so if you select "Anywhere" it will fill the address field with 0.0.0.0/0. If you choose "My IP" it will set it to your IP address as a /32. If you choose "Custom IP" (which is the default) then you'll have to fill in your own address in CIDR format.

Anywhere

"Anywhere" does exactly what it says and will allow connections from any source IP address.

My IP

"My IP" will populate the rule with the IP address that you're currently using to connect to AWS.

Custom IP

"Custom IP" lets you specify a custom IP range.

Drew Khoury
  • 4,637
  • 8
  • 27
  • 28
Bruce P
  • 2,193
  • 3
  • 18
  • 21