In CentOS 7 which comes with FirewallD, enabling HTTP access was easy:
firewall-cmd --permanent --zone=public --add-service=http
However,
firewall-cmd --permanent --zone=public --add-service=ftp
doesn't work: the rule applies, but I can't access FTP by any means except disabling FirewallD.
Some diagnostic info:
- I have checked the service definition file (ftp.xml) and it makes use of nf_conntrack_ftp module.
- On my VPS the module is compiled into kernel (not separate) so it's not there via lsmod, but I can confirm it's there by this:
zgrep FTP /proc/config.gz
CONFIG_NF_CONNTRACK_FTP=y
CONFIG_NF_CONNTRACK_TFTP=y
CONFIG_NF_NAT_FTP=y
CONFIG_NF_NAT_TFTP=y
I did not researched the issue throughly, so I do not understand the details, but it seems this has something to do with how the active - passive connections are setup both for vsftpd on the server and for the client (ex: Filezilla).
Basically you will need to:
pasv_enable=Yes pasv_max_port=40000 pasv_min_port=40000
systemctl restart vsftpd.service
firewall-cmd --permanent --add-port=40000/tcp firewall-cmd --reload
lftp
. For setting Filezilla to use active mode check http://www.itzgeek.com/how-tos/linux/centos-how-tos/enable-passive-mode-in-ftp-on-centos-7-rhel-7-for-filezilla-and-winscp.html#axzz3X4loTCMitry: edit
/etc/vsftpd/vsftpd.conf
Then:
I use vsftp server & FileZilla Client can working