Маленькая заметка от Jidish Gohil.

Отредактируйте /etc/sysconfig/SuSEfirewall2:

здесь не надо открывать порт для ssh

    FW_SERVICES_EXT_TCP=""
    FW_CONFIGURATIONS_EXT=""

добавьте это правило:

    FW_SERVICES_ACCEPT_EXT="0.0.0.0/0,tcp,22,,hitcount=3,blockseconds=60,recentname=ssh"

перезапустите файерволл:

    rcSuSEfirewall2 restart

Теперь у атакующего будет только три попытки до того момента, как он будет заблокирован.

Кстати, вот заодно и вывод iptables-save, как и просили:

    home:/etc/sysconfig # iptables-save

    # Generated by iptables-save v1.4.2-rc1 on Thu Jul 16 23:10:49 2009
    *raw
    :PREROUTING ACCEPT [1473494:1762742144]
    :OUTPUT ACCEPT [1455294:88928001]
    -A PREROUTING -i lo -j NOTRACK
    -A OUTPUT -o lo -j NOTRACK
    COMMIT

    # Completed on Thu Jul 16 23:10:49 2009
    # Generated by iptables-save v1.4.2-rc1 on Thu Jul 16 23:10:49 2009
    *filter
    :INPUT DROP [0:0]
    :FORWARD DROP [0:0]
    :OUTPUT ACCEPT [0:0]
    :forward_ext - [0:0]
    :input_ext - [0:0]
    :reject_func - [0:0]
    -A INPUT -i lo -j ACCEPT
    -A INPUT -m state --state ESTABLISHED -j ACCEPT
    -A INPUT -p icmp -m state --state RELATED -j ACCEPT
    -A INPUT -i eth0 -j input_ext
    -A INPUT -i wlan0 -j input_ext
    -A INPUT -i pan0 -j input_ext
    -A INPUT -i wmaster0 -j input_ext
    -A INPUT -j input_ext
    -A INPUT -m limit --limit 3/min -j LOG --log-prefix "SFW2-IN-ILL-TARGET " \
        --log-tcp-options --log-ip-options
    -A INPUT -j DROP
    -A FORWARD -m physdev  --physdev-is-bridged -j ACCEPT
    -A FORWARD -m limit --limit 3/min -j LOG --log-prefix "SFW2-FWD-ILL-ROUTING " \
        --log-tcp-options --log-ip-options
    -A OUTPUT -o lo -j ACCEPT
    -A OUTPUT -m state --state NEW,RELATED,ESTABLISHED -j ACCEPT
    -A OUTPUT -m limit --limit 3/min -j LOG --log-prefix "SFW2-OUT-ERROR " \
        --log-tcp-options --log-ip-options
    -A input_ext -m pkttype --pkt-type broadcast -j DROP
    -A input_ext -p icmp -m icmp --icmp-type 4 -j ACCEPT
    -A input_ext -p icmp -m icmp --icmp-type 8 -j ACCEPT
    -A input_ext -p tcp -m limit --limit 3/min -m tcp --dport 22 -m state --state NEW -m \
        recent --rcheck --seconds 60 --hitcount 3 --name ssh --rsource -j LOG \
        --log-prefix "SFW2-INext-DROPr " --log-tcp-options --log-ip-options
    -A input_ext -p tcp -m tcp --dport 22 -m state --state NEW -m recent --update \
        --seconds 60 --hitcount 3 --rttl --name ssh --rsource -j DROP
    -A input_ext -p tcp -m tcp --dport 22 -m state --state NEW -m limit --limit 3/min \
        -j LOG --log-prefix "SFW2-INext-ACC " --log-tcp-options --log-ip-options
    -A input_ext -p tcp -m tcp --dport 22 -m state --state NEW -m recent --set --name \
        ssh --rsource -j ACCEPT

    -A input_ext -p tcp -m tcp --dport 22 -j ACCEPT
    -A input_ext -m limit --limit 3/min -m pkttype --pkt-type multicast -j LOG \
        --log-prefix "SFW2-INext-DROP-DEFLT " --log-tcp-options --log-ip-options
    -A input_ext -m pkttype --pkt-type multicast -j DROP
    -A input_ext -p tcp -m limit --limit 3/min -m tcp --tcp-flags FIN,SYN,RST,ACK SYN \
        -j LOG --log-prefix "SFW2-INext-DROP-DEFLT " --log-tcp-options --log-ip-options
    -A input_ext -p icmp -m limit --limit 3/min -j LOG \
        --log-prefix "SFW2-INext-DROP-DEFLT " --log-tcp-options --log-ip-options
    -A input_ext -p udp -m limit --limit 3/min -j LOG \
        --log-prefix "SFW2-INext-DROP-DEFLT " --log-tcp-options --log-ip-options
    -A input_ext -m limit --limit 3/min -m state --state INVALID -j LOG \
        --log-prefix "SFW2-INext-DROP-DEFLT-INV " --log-tcp-options --log-ip-options
    -A input_ext -j DROP
    -A reject_func -p tcp -j REJECT --reject-with tcp-reset
    -A reject_func -p udp -j REJECT --reject-with icmp-port-unreachable
    -A reject_func -j REJECT --reject-with icmp-proto-unreachable
    COMMIT

    # Completed on Thu Jul 16 23:10:49 2009