As per the title.

I built up an ec2 instance that was working and created an image of it. On restart both the original vm and the and vms made using the image do not have port 22 open.

It has happened to me a few time now and I doubled checked to make sure the centos firewall was disabled before restarting.

Any ideas?

  • Is Selinux blocking port 22 on ur CentOS ec2 instance? Commented Sep 24, 2013 at 6:18
  • Not that I know of. I used a pre-created AMI to create this instance, then installed ruby 2 and was still able to ssh in. as soon as I created a new AMI which was to include Ruby 2 it stopped working. i.e. port 22 is closed. It has happened twice now. Commented Sep 24, 2013 at 6:23
  • Check the ec2 security group.
    – user9517
    Commented Sep 24, 2013 at 9:05
  • Thanks for your help. Turns out when I started with the exact same Amazon AMI without any mods it also closed port 22 on reboot. It was the default Red Hat AMI that Amazon provides. Not sure what's going on. Changed to a different image and haven't had the same problem. Commented Sep 25, 2013 at 12:13

1 Answer 1


Go to your EC2 AWS Console, under NETWORK & SECURITY click on Security Group, click on the security group that you have assigned to your EC2 instance.

On the bottom of the page Click on Inbound and create a new rule and open port 20, if you just want to test with it yourself for the time being while you discover & learn your EC2 just set the rule to All Traffic, click on add rule and then apply it.

remember to change it afterwards as thats not the most secure rule, but it can help while you are learning in a test environment.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .