Created
May 6, 2017 02:47
-
-
Save epcnt19/06e8e53432000591a017fab784979d57 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 | |
iptables -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT | |
iptables -A INPUT -p icmp -j ACCEPT | |
iptables -A INPUT -i lo -j ACCEPT | |
iptables -A INPUT -p tcp -m state --state NEW -m tcp --dport 22 -j ACCEPT | |
iptables -A INPUT -p tcp -m state --state NEW -m tcp --dport 80 -j ACCEPT | |
iptables -A INPUT -p tcp -m state --state NEW -m tcp --dport 443 -j ACCEPT | |
iptables -A INPUT -j REJECT --reject-with icmp-host-prohibited | |
service iptables save | |
service iptables restart |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment