InfraKit 39+ Programmatic Tools

Port 21 – FTP-Control Protocol Specification

Technical analysis, security advisories, vulnerability mitigation, and firewall syntax for TCP/UDP port 21 (FTP-Control).

Port Number 21
Transport Protocol TCP
Port Range Type Well-Known (0-1023)
Default Status Restricted / LAN

Service Description & Architectural Context

File Transfer Protocol command and session control.

IANA / RFC Designation:

Port 21 is assigned to FTP-Control under the Internet Assigned Numbers Authority (IANA) service name registry. In enterprise infrastructure and homelab setups, services listening on this port must follow the principle of least privilege.

Security Analysis & Attack Surface Assessment
Transmits credentials in plaintext. Vulnerable to sniffing and MITM attacks.
Hardening Recommendations:
  • Do not expose port 21 to public WAN interfaces unless authenticated TLS or VPN wrapping is strictly enforced.
  • Enforce rate-limiting using Fail2ban, CrowdSec, or cloud edge DDoS protection.
  • Audit active listening sockets locally: ss -tulpn | grep :21 or netstat -ano | findstr :21.

Firewall Rule Snippets for Port 21

UFW (Ubuntu / Debian Linux)
sudo ufw allow 21/tcp
iptables (Standard Linux Kernel)
sudo iptables -A INPUT -p tcp --dport 21 -j ACCEPT
Windows PowerShell (Defender Advanced Firewall)
New-NetFirewallRule -DisplayName "Allow Port 21" -Direction Inbound -LocalPort 21 -Protocol TCP -Action Allow

Quick Port Jump