Skip to content

Instantly share code, notes, and snippets.

@aviddiviner
Created July 3, 2016 02:25
Show Gist options
  • Save aviddiviner/a925e314b107920947dcd5795d21ae74 to your computer and use it in GitHub Desktop.
Save aviddiviner/a925e314b107920947dcd5795d21ae74 to your computer and use it in GitHub Desktop.
EC2 user-data script to run SSH on port 443 on startup
#!/bin/bash -ex
perl -pi -e 's/^#?Port 22$/Port 443/' /etc/ssh/sshd_config
service sshd restart || service ssh restart
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment