FTP Control
What is Port 21?
Port 21 is the control channel for the File Transfer Protocol (FTP), one of the oldest and most widely used protocols for transferring files over TCP/IP networks. Defined in RFC 959, FTP uses a dual-port architecture: port 21 manages the session, handles authentication, and processes commands like LIST, RETR, and STOR, while port 20 (in active mode) carries the actual file data. FTP has been a cornerstone of internet file sharing since the early days of networking and predates the World Wide Web. Despite the rise of SFTP and cloud storage, FTP remains common for web hosting panels, automated data feeds, and legacy enterprise workflows. Nearly every operating system ships with an FTP client, and many web hosting providers still offer FTP access as a standard feature.
Common Uses
- Web hosting file uploads and management
- Automated data exchange between business systems
- Firmware updates for network devices
- Legacy application file distribution
Technical Details
Copy-paste commands to check port 21 (FTP Control) from your terminal
Test connectivity
nc -zv example.com 21
curl -v --max-time 5 http://example.com:21/
telnet example.com 21
nmap -p 21 -sV example.com
(echo > /dev/tcp/example.com/21) 2>/dev/null && echo "open" || echo "closed"
Open port in firewall
sudo ufw allow 21/tcp
sudo iptables -A INPUT -p tcp --dport 21 -j ACCEPT
sudo firewall-cmd --permanent --add-port=21/tcp && sudo firewall-cmd --reload
Security Considerations
FTP sends usernames, passwords, and file contents in plaintext. This makes it extremely vulnerable to credential theft and data interception. Attackers frequently scan for open port 21 to find misconfigured servers. Always prefer SFTP or FTPS. If FTP is required, enforce strong passwords, restrict by IP, and never use anonymous FTP with write access.
Popular Ports Reference
The most commonly used and referenced network ports