有 firewall 的使用以下命令。

firewall-cmd --zone=public --add-port=21/tcp --permanent
modprobe ip_conntrack_ftp
firewall-cmd --reload

没有 firewall 的使用 iptables。

iptables -A INPUT -p tcp --dport 21 -j ACCEPT
iptables -A OUTPUT -p tcp --sport 20 -j ACCEPT
modprobe ip_conntrack_ftp

  1. Allowing FTP with IPTables
  2. Setting up Linux iptables for FTP PASV mode connections
  3. Open firewall port on CentOS 7
  4. How to make CentOS Linux to load a module automatically at boot time?

发表回复

您的电子邮箱地址不会被公开。