Skip to content

Instantly share code, notes, and snippets.

@awaxa
Created January 22, 2016 18:22
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 awaxa/76d4956df1554f70c297 to your computer and use it in GitHub Desktop.
Save awaxa/76d4956df1554f70c297 to your computer and use it in GitHub Desktop.
#!/usr/bin/env sh
iptables -F
iptables -I INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A INPUT -p tcp --tcp-flags ALL NONE -j DROP
iptables -A INPUT -p tcp ! --syn -m state --state NEW -j DROP
iptables -A INPUT -p tcp --tcp-flags ALL ALL -j DROP
iptables -A INPUT -i lo -j ACCEPT
iptables -A INPUT -p tcp -m tcp --dport 22 -j ACCEPT
iptables -A INPUT -j DROP
iptables -P OUTPUT ACCEPT
iptables -P INPUT ACCEPT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment