Open menu

Learn

What is Port 21 Used For?

Port 21 is a well-known port primarily used for FTP (File Transfer Protocol) control commands. FTP is a standard network protocol used for transferring files from one host to another over a TCP-based network, such as the internet. FTP uses two ports by default: Port 21 for control commands and Port 20 for data transfer. The control connection established on Port 21 is used for the client to send administrative commands to the server, such as username, password, or the specific file request. The server's responses are also sent back over this connection. Therefore, Port 21 is crucial for initiating and maintaining communication between the FTP client and server. As Port 21 is a known target for attacks, it's commonly managed by firewalls, which can block or allow data based on security rules. System administrators typically open Port 21 only if necessary and monitor its activity closely. If FTP service is required, it's often advised to limit the source IP addresses that can connect to Port 21, minimizing the risk of unauthorized access.