File transfer ports: FTP 20 and 21, SFTP, FTPS and others
What the IANA registry records for these ports, and how to use them safely.
What IANA records
| Port | Protocols | Registered name | IANA description | Assignee | Reference | Note |
|---|---|---|---|---|---|---|
| 20 | tcp, udp, sctp | ftp-data | File Transfer [Default Data] | Jon Postel | n/a | |
| 21 | tcp, udp, sctp | ftp | File Transfer Protocol [Control] | Jon Postel | [RFC 959] | Defined TXT keys: u=<username> p=<password> path=<path> |
| 22 | tcp, udp, sctp | ssh | The Secure Shell (SSH) Protocol | n/a | [RFC 4251] | Defined TXT keys: u=<username> p=<password> |
| 445 | tcp, udp | microsoft-ds | Microsoft-DS | Pradeep Bahl | n/a | |
| 69 | tcp, udp | tftp | Trivial File Transfer | David Clark | n/a |
FTP, SFTP and FTPS are three different things
- FTP (File Transfer Protocol) uses port 21 for commands, and a second connection (traditionally port 20) for data. It sends passwords and data without encryption.
- SFTP is not FTP. It is a file transfer service that runs inside an SSH connection, on port 22. It is encrypted and needs only one port.
- FTPS is FTP with TLS encryption added. It still has the two-connection complication.
- TFTP (port 69) is a very simple, unauthenticated file transfer used for network equipment boot files. Never expose it to the internet.
- SMB (port 445, registered as
microsoft-ds) is Windows file and printer sharing.
Safe habits
- Use SFTP rather than FTP for moving files to a server.
- Never expose SMB (445) to the internet. It has been used in major worm attacks. Allow it only inside your network.
- If a provider offers only FTP, ask for SFTP or FTPS, and use a password that you use nowhere else.
- Close port 21 on servers that do not need it.
- Use separate accounts with limited folders for file transfer.
Firewall note
Classic FTP needs extra connections that many firewalls handle with special rules. If an FTP login works but listing folders hangs, a firewall is blocking the data connection; switching to SFTP avoids the problem.
This is an independent guide. It is not connected with IANA, the IETF or any network equipment maker. Address and port data come from the IANA registries as fetched on 14 November 2026; RFC texts were read from rfc-editor.org. Check the originals for anything you rely on.