Ftp active connection and passive connection, but not firewall settings active connection: port connection mode means that the client establishes a connection with the ftp server through ftp port (21) to form a link, when data transmission is required, the client uses port to open a port on the link and tells the ftp server its own port number, then the ftp server can communicate with the port number of the client through its own port 20, establish a connection, and perform data transmission. The firewall settings are also relatively simple, you only need to control the connection to port 21. For example, iptables-a input-p tcp-s 192.168.1.0/24 -- dport 21-j ACCEPT can bring the client online for passive connections: pasv connection means that the client establishes a connection with the ftp server through the ftp port to form a link. When data needs to be transmitted, the server opens a port through the pasv command on the link, tell the client to establish a connection through this port, transfer files, firewall settings will take one more step first, you need to modify the ftp configuration file vim/etc/vsftpd. conf pasv_min_port = 6000 pasv_max_port = 6100 and then add the firewall rule iptables-a input-p tcp-s 192.168.1.0/24 -- dport-j ACCEPT iptables-a input-p tcp-s 192.168.1.0/24 -dport 6000: 6100-j ACCEPT