



The client connects from another random port to the random port specified in the server's response.The server replies, indicating which (random) port it has opened for data transfer. The client connects from a random port to port 21 on the server and issues the PASV command.Here's how passive mode works in a nutshell: When the FTP server replies, it indicates what data port number it has opened for the ensuing data transfer. However, instead of sending the PORT command, it sends the PASV command, which is basically a request for a server port to connect to for data transmission. In passive mode, the client still initiates a command channel (control connection) to the server. Once the data connection is established, file transfers are then made through these client and server ports. The server connects from port 20 to the client port designated for the data channel.This port will be used later on for the data channel and is different from the port used in this step for the command channel. It sends the PORT command, specifying what client-side port the server should connect to. A user connects from a random port on a file transfer client to FTP port 21 on the server.ACK replies) have been omitted to simplify things. Here's a simplified explanation on how an active mode connection is carried out, summarized in two steps. Active FTP was introduced in the early days of computing when mainframes were more common and attacks to information security were not as prevalent. Active Mode FTPĪmong the two connection modes, active mode is the older one. We'll include client-side FTP ports in our discussion in a short while. Note that the FTP ports we are referring to up to this point are only the ports on the server side. But if you choose passive mode, then the port that will be used will be a random port. If you choose active mode, then the data channel will normally be FTP port 20. The FTP port you'll use for the data channel, on the other hand, can differ depending on which data transfer mode you choose. Unless you configure your FTP server differently, you will normally set your command channel to use FTP port 21.
