Skip to content

Instantly share code, notes, and snippets.

@amalc
Created December 18, 2012 18:28
Show Gist options
  • Save amalc/4330596 to your computer and use it in GitHub Desktop.
Save amalc/4330596 to your computer and use it in GitHub Desktop.
iptables - only ssh.
sudo iptables -F
sudo iptables -I INPUT 1 -i lo -j ACCEPT
sudo iptables -A INPUT -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT
sudo iptables -A INPUT -p tcp --dport ssh -j ACCEPT
sudo iptables -A INPUT -j DROP
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment