

FTP server’s ports > 1023 to remote ports > 1023 (Server sends ACKs (and data) to client’s data port).FTP server’s ports > 1023 from anywhere (Client initiates data connection to random port specified by server).FTP server’s port 21 to ports > 1023 (Server responds to client’s control port).FTP server’s port 21 from anywhere (Client initiates connection).This alleviates firewall connection from Active FTP, with the client initiating the request. The server sends the PORT p command to the client and the client will initiate the transfer of the data on port N+1. Passive FTP differs, by opening two random ports, the first issuing the command PASV to the command port. FTP server’s port 20 from ports > 1023 (Client sends ACKs to server’s data port).FTP server’s port 20 to ports > 1023 (Server initiates data connection to client’s data port).The server will then connect back to the client port to port 20. The client listens to the random port number (N+1) and sends this to the command port 21.

Active FTPĪctive FTP client connects from a random port (N) to the control channel port 21. There are two types of modes active and passive FTP, using normal or passive FTP, a client initiates a session by sending a request to communicate through TCP port 21, port 21 being the (Control Channel connection or Command Port). It’s very rare that I setup FTP servers on our production environments and always forget parts of the configuration, so figured I would list it here.
