Userdata to run ssh on port 80 for AWC EC2 instances

Sometimes outbound SSH access is blocked by firewalls.

You can get an AWS EC2 instance to run sshd on TCP/80 by adding the following userdata when the instance is launched.

sed -i 's/#Port 22/Port 80/g' /etc/ssh/sshd_config
service sshd restart || service ssh restart

Leave a Reply

Your email address will not be published. Required fields are marked *