The ports you must know
| Port | Protocol | Service |
|---|---|---|
| 20 / 21 | TCP | FTP — file transfer (20 data, 21 control) |
| 22 | TCP | SSH / SCP / SFTP — secure shell & transfer |
| 23 | TCP | Telnet — unencrypted remote login |
| 25 | TCP | SMTP — sending email |
| 53 | TCP/UDP | DNS — name resolution |
| 67 / 68 | UDP | DHCP — IP assignment (67 server, 68 client) |
| 69 | UDP | TFTP — trivial file transfer |
| 80 | TCP | HTTP — web |
| 110 | TCP | POP3 — receiving email |
| 123 | UDP | NTP — time sync |
| 143 | TCP | IMAP — email with server-side folders |
| 161 / 162 | UDP | SNMP — network management (162 traps) |
| 389 | TCP/UDP | LDAP — directory services |
| 443 | TCP | HTTPS — web over TLS |
| 445 | TCP | SMB — Windows file sharing |
| 636 | TCP | LDAPS — LDAP over TLS |
| 993 / 995 | TCP | IMAPS / POP3S — secure email |
| 3389 | TCP | RDP — Windows remote desktop |
| 3306 / 5432 | TCP | MySQL / PostgreSQL databases |
Plaintext vs secure pairs
Many services have a plaintext port and a TLS-secured sibling: HTTP 80 → HTTPS 443, IMAP 143 → IMAPS 993, POP3 110 → POP3S 995, LDAP 389 → LDAPS 636. Prefer the secure port in production.
The three port ranges
- Well-known: 0–1023 (the services above).
- Registered: 1024–49151 (vendor apps, e.g. 3306, 3389).
- Dynamic / ephemeral: 49152–65535 (temporary client-side ports).
Test yourself
4 quick questions — tap an answer to check it instantly. Nothing is sent anywhere.
1. Which port does SSH use?
2. DNS primarily uses which port?
3. Which is the secure version of IMAP?
4. RDP (Windows Remote Desktop) uses which port?
Sources
- IANA — Service Name and Transport Protocol Port Number Registry.
- CompTIA Network+ / Security+ exam objectives.
Reference summary only. Authoritative assignments are in the IANA Service Name and Transport Protocol Port Number Registry.