1. 程式人生 > >iptbales 允許訪問vsftp

iptbales 允許訪問vsftp

war ipo 端口 -- min tcp table cep 文件

1、允許20 21 端口
iptables -I INPUT -p tcp -m multiport --dport 20,21 -j ACCEPT

2、允許關聯包通過
iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT

3、我們編輯vsftpd.conf 文件,在文件裏邊的最後面添加兩行,並重啟vsftpd
pasv_min_port=61001
pasv_max_port=62000

4、允許61001到62000端口範圍通過
iptables -A INPUT -p TCP --dport 61001:62000 -j ACCEPT

5、關閉selinux
setenforce 0

6、允許22端口,並阻止默認通過
iptables -I INPUT -p tcp --dport 22 -j ACCEPT
iptables -P INPUT DROP
iptables -P OUTPUT ACCEPT
iptables -P FORWARD ACCEPT

iptbales 允許訪問vsftp