Skip to content

Instantly share code, notes, and snippets.

@epcnt19
Created May 6, 2017 02:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save epcnt19/06e8e53432000591a017fab784979d57 to your computer and use it in GitHub Desktop.
Save epcnt19/06e8e53432000591a017fab784979d57 to your computer and use it in GitHub Desktop.
#!/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