What Is TCP Port 21 (FTP)?

TCP port 21 was one of the most popular port in the early days of the internet. TCP 21 is used by the FTP or File Transfer Protocol y default. FTP is one of the oldest protocols created for the internet. The TCP port 21 is used to control FTP protocol between client and server. The FTP servers listen for the TCP port 21 in order to incoming connection requests and when the connection is established the transmission of the data is controlled via these sessions by using the TCP port 21.

TCP Port 21 FTP Control

The port 21 is used to control FTP sessions and data transmission. FTP provides different control commands like User, PASS, ACCT, CWD, CDUP, SMNT, etc.

TCP Port 20 FTP Data Transmission

Sometimes the TCP port 20 and TCP port 21 are related to each other. This is true as TCP port 20 is used for FTP data transmission. So the data transmitted over the TCP port 20 is managed and controlled via the TCP port 21.

Find TCP Port 21

Well, you may ask how can I detect and find TCP port 21. There are different ways and methods to accomplish this. The nmap command can be used to scan the network and find the TCP port 21 like below.

$ nmap -p 21 192.168.1.20/24

If we only want to list the current system TCP port 21 there are different commands related to different operating systems. For the Windows operating systems the netstat command can be used to list if the TCP port 21 is open and running.

> netstat -a

For the Linux operating systems the netstat command can be also used with the -l option to list if the TCP port 21 is running and listening.

$ netstat -l

Leave a Comment