======FTP======
=====Configure VSFTPD Ports=====
The FTP protocol uses two TCP connections. You have port 21, the command and login connection, and a second connection, the data connection.
With passive FTP the second connection is to a randomly assigned available TCP port above 1024.
While it is easy to open port 21 on the firewall, you have to specify a port range that VSFTPD can use for the passive connections.
You can configure vsftpd to use a range of ports and then open those ports by editing the file ''/etc/vsftpd/vsftpd.conf'' and adding the following to the file. In this example, we configure vsftpd to use port 212-2142.
# reserve TCP ports 2121-2142 for passive FTP
pasv_min_port=2121
pasv_max_port=2142
You then need to open the firewall to allow TCP connections to these ports. To open the range of ports with one command, use this
iptables -I INPUT -p tcp -m state --state NEW -m tcp -m multiport --dports 2121:2142 -j ACCEPT