FTP Port

One of two ports (Port 21 and Port 20) that serves a specific role in the FTP communication process.

Port 21 (Control Port): This is the primary port used by the FTP server. It's used for the client to connect to the server and send control commands. These commands include user authentication (login with username and password), as well as commands to change the directory, list directories, etc. The communication over this port is used to establish and manage a session between the client and server.

Port 20 (Data Port): Once a command that involves transferring files (like `GET` for downloading a file or `PUT` for uploading a file) is sent through the control port, the actual data transfer takes place over Port 20. This is the port through which the files and directory listings are transferred.

FTP can operate in two modes: Active and Passive. In Active mode, the server connects to the client through Port 20 for data transfer, which can cause issues with firewalls on the client side. In Passive mode, the server opens a port and communicates the port number to the client over the control port. The client then initiates the data connection to the server on the provided port number. Passive mode is more firewall-friendly as it allows the client to initiate all connections.

Back to Glossary