TCPWell-Known PortFirewall: Usually Closed
21

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

Port Number21
ProtocolTCP
CategoryWell-Known
Service NameFTP Control
Default FirewallUsually Closed
Port Test Commands

Copy-paste commands to check port 21 (FTP Control) from your terminal

Test connectivity

Netcat (nc)Check if TCP port is reachable
nc -zv example.com 21
curl (HTTP)Test HTTP response on this port
curl -v --max-time 5 http://example.com:21/
TelnetBasic TCP port connectivity check
telnet example.com 21
nmapScan port 21 with service detection
nmap -p 21 -sV example.com
Bash /dev/tcpPure bash TCP check (no extra tools needed)
(echo > /dev/tcp/example.com/21) 2>/dev/null && echo "open" || echo "closed"

Open port in firewall

UFW (Ubuntu / Debian)
sudo ufw allow 21/tcp
iptables
sudo iptables -A INPUT -p tcp --dport 21 -j ACCEPT
firewalld (RHEL / CentOS)
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

Related Ports