我有一个运行在Centos 6.6上的networking服务器。 最近Config服务器安全防火墙发给我超过150封电子邮件,告诉我有些恶意机器人试图猜测我的客户端ftp用户和密码。 我讨厌bruteforce攻击,我尝试将我的ftp端口从21更改为****。 我configuration了我的purefptd.conf
# IP address/port to listen to (default=all IP and port 21). Bind *** # My New Port Here Without 127.0.0.1
然后我允许在我的csfconfiguration文件新的端口所有TCP_IN,TCP_OUT,UDP_IN,UDP_OUT IPv4和IPv6,并添加iptables规则后资源
iptables -A INPUT -p tcp --dport newport -j ACCEPT iptables -A OUTPUT -p tcp --dport newport -j ACCEPT iptables -A INPUT -p udp --dport newport -j ACCEPT iptables -A OUTPUT -p udp --dport newport -j ACCEPT service iptables save service iptables restart
更改后,我重新启动pureftpd和csf。 现在,当我试图通过Filezilla 3.9.0.6连接到我的ftp服务器时,它给了我这个答案。
Response: 227 Entering Passive Mode (*,*,*,*) Command: MLSD Error: Connection timed out Error: Failed to retrieve directory listing
我自己find了答案。 我将pureftp conf文件的被动连接行更改为:
# Port range for passive connections replies. - for firewalling. PassivePortRange 50000 51000
并允许它在50000:51000上的csfconfiguration文件
TCP_IN IPv4和IPv6。
现在它工作正常。