Last active
August 29, 2015 14:06
-
-
Save yoshi0309/9b4ef8205d69cde48ed3 to your computer and use it in GitHub Desktop.
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 -ex | |
exec > >(tee /var/log/user-data.log|logger -t user-data -s 2>/dev/console) 2>&1 | |
perl -pi -e 's/^#?Port 22$/Port 22\nPort 443/' /etc/ssh/sshd_config | |
semanage port -m -t ssh_port_t -p tcp 443 | |
iptables -A INPUT -m state --state NEW -m tcp -p tcp --dport 443 -j ACCEPT | |
iptables -D INPUT -j REJECT --reject-with icmp-host-prohibited | |
iptables -A INPUT -j REJECT --reject-with icmp-host-prohibited | |
service iptables save | |
service iptables restart | |
service sshd restart |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment