Skip to content

Instantly share code, notes, and snippets.

@vgrish
Created October 31, 2013 12:32
Show Gist options
  • Save vgrish/7248912 to your computer and use it in GitHub Desktop.
Save vgrish/7248912 to your computer and use it in GitHub Desktop.
#!/bin/bash
# Очистка цепочек правил
iptables -F INPUT
iptables -Z INPUT
iptables -P INPUT ACCEPT
iptables -F OUTPUT
iptables -Z OUTPUT
iptables -P OUTPUT ACCEPT
iptables -F FORWARD
iptables -Z FORWARD
iptables -P FORWARD ACCEPT
# Защита порта ssh, время блокировки - 30 секунд
iptables -A INPUT -p tcp -m state --state NEW --dport 22 -m recent --update --seconds 30 -j DROP
iptables -A INPUT -p tcp -m state --state NEW --dport 22 -m recent --set -j ACCEPT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment