Port 20: FTP data

Port 20 (TCP) is used by FTP data. Data channel for active-mode FTP transfers. Passive mode uses high ports instead.

20Port
TCPProtocol
ftp-dataIANA service name
File transferCategory

Port range

20 is a well-known (system) port (range 0–1023). On Linux and macOS, binding to it traditionally needs root or the CAP_NET_BIND_SERVICE capability.

Security

Only open port 20 to the hosts that need it. Prefer the encrypted variant of the protocol where one exists.

Open port 20 in a firewall

ufw         sudo ufw allow 20/tcp
iptables    sudo iptables -A INPUT -p tcp --dport 20 -j ACCEPT
firewalld   sudo firewall-cmd --permanent --add-port=20/tcp
Windows     New-NetFirewallRule -DisplayName "FTP data 20" -Direction Inbound -Protocol TCP -LocalPort 20 -Action Allow

Check if port 20 is open

nc -vz example.com 20
Test-NetConnection example.com -Port 20   # PowerShell
sudo ss -tulpn | grep ':20 '   # what is listening locally (Linux)

Other file transfer ports

Frequently asked questions

What is port 20 used for?
FTP data. Data channel for active-mode FTP transfers. Passive mode uses high ports instead.
Is port 20 TCP or UDP?
TCP.