PF Firewall Open FTP Port 21 (PASSIVE Configu…
2009-05-13 15:30:26来源:未知 阅读 ()
Question:I've
[url=javascript:;]vsftpd[/url]
[url=javascript:;]ftp[/url]
server configured under
[url=javascript:;]FreeBSD[/url]
7.x andPF firewall. Both PF and FTP server running on a dedicated FreeBSD web server. How do I configure
PASSIVE
FTP PF firewallconfiguration so that my vsftpd work? How do I configurePF firewall to protect an FTP server and open port 21?
Answer:You can easily open port with PF firewall. However, you need to make few changes to VSFTPD server itself. When servicing a passive FTP connection, FTP will use a randomly chosen, high TCP port for incoming data. Open vsftpd.conf file:
# vi /usr/local/etc/vsftpd.conf
Append following two config directive to setup ftp port ranges:
pasv_min_port=49152
pasv_max_port=65535
Save and close the file. Restart vsftpd:
# /usr/local/etc/rc.d/vsftpd restart
PF firewall configuration - Open port 21
Open pf.conf file:
# vi /etc/pf.conf
Append following two rules (202.54.1.2 is FTP server IP address):
pass in on $ext_if proto tcp from any to 202.54.1.2 port 21 flags S/SA synproxy state
pass in on $ext_if proto tcp from any to 202.54.1.2 port > 49151 keep state
Make sure outgoing connection tracking also exists:
# keep stats of outgoing connections
pass out keep state
Save and close the file. Reload PF firewall:
# /etc/rc.d/pf reload
本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/4206/showart_1386026.html
标签:
版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com
特别注意:本站所有转载文章言论不代表本站观点,本站所提供的摄影照片,插画,设计作品,如需使用,请与原作者联系,版权归原作者所有
- FreeBSD下nginx+fast-cgi+mysql+zend的实现 2009-05-13
- virtualbox for freeBSD 2009-05-13
- 讨论一下package和port一起使用的问题。 2009-05-13
- 安装'User manager for PureFTPd'无法建表? 2009-05-13
- freebsdchina的Ftp到位了,不用再悲剧了 2009-05-13
IDC资讯: 主机资讯 注册资讯 托管资讯 vps资讯 网站建设
网站运营: 建站经验 策划盈利 搜索优化 网站推广 免费资源
网络编程: Asp.Net编程 Asp编程 Php编程 Xml编程 Access Mssql Mysql 其它
服务器技术: Web服务器 Ftp服务器 Mail服务器 Dns服务器 安全防护
软件技巧: 其它软件 Word Excel Powerpoint Ghost Vista QQ空间 QQ FlashGet 迅雷
网页制作: FrontPages Dreamweaver Javascript css photoshop fireworks Flash