Last active
July 4, 2016 01:28
-
-
Save albertstartup/ebac15d302c601f148165c8b22e24323 to your computer and use it in GitHub Desktop.
aws user-data to change ssh port
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
sudo perl -pi -e 's/^#?Port 22$/Port 443/' /etc/ssh/sshd_config | |
sudo service ssh restart |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
or
sudo perl -pi -e 's/^#?Port 22$/Port 443\nPort 22/' /etc/ssh/sshd_config