I have an Amazon EC2 instance, and can't seem to figure out how to open additional ports.

I've added the ports to a security group, and assigned the group to the instance, but the ports are still not open. Only port 22 is open, which I believe is the default behavior. I can't open any other ports.

The instance is running Ubuntu. Firewall on the instance is disabled with ufw disable. Any help is really appreciated. I use https://www.yougetsignal.com/tools/open-ports/ to test my ports.

Here's my security group configuration:

enter image description here

  • 1
    What exactly isn't working? Testing ports isn't open can be interesting, but it's not a goal. You need a service listening on a port to really determine if it's open. Since ssh works your setup is probably correct. Port 22 being open is definitely not default behaviour, and you should limit what IPs can connect using SSH.
    – Tim
    Oct 3, 2017 at 0:58
  • Could you check your config for network acl under your VPC subnet?
    – shogo2022
    Oct 3, 2017 at 6:57
  • figured it out. needed to add GatewayPorts yes to my sshd_config file
    – ipwnmice
    Oct 4, 2017 at 7:28
  • Also I think Tim was right, I didn't have a service listening when I was testing initially.
    – ipwnmice
    Oct 4, 2017 at 7:34

1 Answer 1


Your security group settings look good. You being able to SSH into the instance is a good sign. I would think that you probably are testing the private IP address or the elastic IP address which may not return the results that you are looking for. Just running #netstat -ant and verifying the ports that way may be a better test for you. Also you can just use telnet to test the ports if its installed.

  • I don't think this is correct, assuming the person asking the question is testing the private IP address. Also, netstat doesn't help all that much because it doesn't tell you if the ports are externally accessible.
    – Tim
    Oct 3, 2017 at 2:08
  • @Tim then please provide a suggestion.
    – ddlingo
    Oct 3, 2017 at 13:22
  • I provided a suggestion in my comment above - nothing listening on the ports. Security group looks fine, but may not be assigned to instance. NACLs could also be involved. There's not enough information to say for sure.
    – Tim
    Oct 3, 2017 at 17:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.