Skip to content

Instantly share code, notes, and snippets.

@craigw
Created July 20, 2009 19:18
Show Gist options
  • Save craigw/150547 to your computer and use it in GitHub Desktop.
Save craigw/150547 to your computer and use it in GitHub Desktop.
sudo apt-get install iptables
sudo iptables -A INPUT -i lo -j ACCEPT
sudo iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
sudo iptables -A INPUT -p tcp --dport ssh -j ACCEPT
sudo iptables -A INPUT -j DROP
sudo sh -c "iptables-save -c > /etc/iptables.rules"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment