如何封锁除1962、999、12020以外的所有端口?
一个用于SSH的端口,另一个用于一个脚本的端口。因此,有必要允许这些端口上的传出,对吗?
我的iptables:
# Generated by iptables-save v1.4.4 on Sat Feb 25 17:25:21 2012
*mangle
:PREROUTING ACCEPT [643521:136954367]
:INPUT ACCEPT [643521:136954367]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [645723:99904505]
:POSTROUTING ACCEPT [645723:99904505]
COMMIT
# Completed on Sat Feb 25 17:25:21 2012
# Generated by iptables-save v1.4.4 on Sat Feb 25 17:25:21 2012
*filter
:INPUT ACCEPT [643490:136950781]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [645723:99904505]
-A INPUT -p tcp -m tcp --dport 1962 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 999 -j ACCEPT
COMMIT
# Completed on Sat Feb 25 17:25:21 2012
# Generated by iptables-save v1.4.4 on Sat Feb 25 17:25:21 2012
*nat
:PREROUTING ACCEPT [5673:734891]
:POSTROUTING ACCEPT [2816:179474]
:OUTPUT ACCEPT [2816:179474]
COMMIT
# Completed on Sat Feb 25 17:25:21 2012
抱歉,但是在这方面我是一个真正的新手,我只想使我的服务器更安全。
为什么不使用UFW?
—
Soviero