Решил настроить iptables для безопасной работы веб-сервера. Делал по этой инструкции http://linux-admin.ru/archives/62 + добавил в список разрешённых 10000 порт для webmin. Вот вывод команды iptables -L --line-number:
[console]
Chain INPUT (policy DROP)
num target prot opt source destination
1 DROP icmp -f anywhere anywhere
2 DROP tcp -- anywhere anywhere ctstate NEW tcpflags:! FIN,SYN,RST,ACK/SYN
3 REJECT tcp -- anywhere anywhere ctstate INVALID,NEW tcpflags: SYN,ACK/SYN,ACK reject-with tcp-reset
4 ACCEPT all -- anywhere anywhere
5 ACCEPT tcp -- anywhere anywhere tcpflags: FIN,SYN,RST,ACK/RST limit: avg 1/sec burst 5
6 ACCEPT tcp -- anywhere anywhere state RELATED,ESTABLISHED
7 ACCEPT udp -- anywhere anywhere state RELATED,ESTABLISHED
8 tcp -- anywhere anywhere tcp dpt:sshflags: FIN,SYN,RST,ACK/SYN recent: SET name: dmitro side: source
9 DROP tcp -- anywhere anywhere tcp dpt:sshflags: FIN,SYN,RST,ACK/SYN recent: UPDATE seconds: 30 hit_count: 3 name: dmitro side: source
10 ACCEPT tcp -- anywhere anywhere tcp dpt:ftp-data
11 ACCEPT tcp -- anywhere anywhere tcp dpt:ssh
12 ACCEPT tcp -- anywhere anywhere tcp dpt:smtp
13 ACCEPT udp -- anywhere anywhere udp spt:domain
14 ACCEPT tcp -- anywhere anywhere tcp dpt:http
15 ACCEPT tcp -- anywhere anywhere tcp dpt:pop3
16 ACCEPT tcp -- anywhere anywhere tcp dpt:imap2
17 ACCEPT tcp -- anywhere anywhere tcp dpt:https
18 ACCEPT tcp -- anywhere anywhere tcp dpt:webmin
19 ACCEPT icmp -- anywhere anywhere icmp destination-unreachable
20 ACCEPT icmp -- anywhere anywhere icmp time-exceeded
21 ACCEPT icmp -- anywhere anywhere icmp parameter-problem
22 ACCEPT tcp -- anywhere anywhere tcp dpt:ftp
23 ACCEPT tcp -- anywhere anywhere tcp spt:ftp-data
24 ACCEPT tcp -- anywhere anywhere tcp spt:ftp
25 ACCEPT tcp -- anywhere anywhere tcp spt:ssh
26 ACCEPT tcp -- anywhere anywhere tcp spt:smtp
27 ACCEPT tcp -- anywhere anywhere tcp spt:http
28 ACCEPT tcp -- anywhere anywhere tcp spt:pop3
29 ACCEPT tcp -- anywhere anywhere tcp spt:imap2
30 ACCEPT tcp -- anywhere anywhere tcp spt:https
31 ACCEPT tcp -- anywhere anywhere tcp spt:webmin
Chain FORWARD (policy ACCEPT)
num target prot opt source destination
Chain OUTPUT (policy ACCEPT)
num target prot opt source destination
1 ACCEPT tcp -- anywhere anywhere tcp dpt:ftp
2 ACCEPT tcp -- anywhere anywhere tcp dpt:ftp-data
3 ACCEPT tcp -- anywhere anywhere tcp dpt:ssh
4 ACCEPT tcp -- anywhere anywhere tcp dpt:smtp
5 ACCEPT tcp -- anywhere anywhere tcp dpt:http
[/console]
Проблема в том что ftp соединения устанавливается, но при этом нельзя прочитать файлы в корневой директории. Выводится сообщение "Failure retrieving contents of directory ....". Что я сделал не правильно?
LinuxForum.Fans
[Решено] iptables и ftp
Автор: neket
6 сообщений
4316 просмотров
ftp в пассивном режиме?
ftp в пассивном режиме?
Да
[quote="Kettler"]ftp в пассивном режиме?
Да[/quote]
Порты не пробывали открыть которые используються в пассивном режиме?
Порты не пробывали открыть которые используються в пассивном режиме?
А какие именно? Разве 21 порта не достаточно?
Проблема решена! Для того чтобы с данными правилами ftp работал в пассивном режиме, необходимо в конфигурационном файле iptables (/etc/sysconfig/iptables-config) добавить строчку
text
IPTABLES_MODULES="ip_conntrack_ftp"Ну и перезагрузить iptables
text
service iptables restart
Войдите или зарегистрируйтесь, чтобы ответить.