Port 21 — FTP
Port 21 carries only FTP’s control channel: the commands and replies. The actual file bytes travel on a second connection, which is what makes FTP uniquely awkward to firewall. In active mode the server connects back to the client from port 20 — which every NAT device and client firewall now blocks, correctly. In passive mode the server opens a listening port in a high range and tells the client where, which is why FTP servers need a configured passive port range explicitly permitted.
The security position is simpler: usernames, passwords and file contents all cross the network in plain text. Our reference marks 21 never, and the practical consequence is that FTP credentials are harvested from shared networks and reused, while the files themselves are readable by anyone on the path. Anonymous FTP servers additionally get indexed and used as malware distribution points.
The replacements are SFTP (a subsystem of SSH, port 22 — one connection, encrypted, key-authenticated) and FTPS (FTP wrapped in TLS on 990/989, which keeps the two-channel design and therefore keeps the firewall pain). SFTP is almost always the right choice; FTPS exists for partners whose systems demand it.
Port 21 at a glance
| Field | Value | Detail |
|---|---|---|
| Port | 21 | Well-known |
| Service | FTP | File Transfer Protocol control channel. (TCP) |
| Category | File & print | file sharing, transfer and printing |
| Exposure | Never | Never expose to the internet |
Should port 21 face the internet? Cleartext passwords, endlessly brute-forced. Replace with SFTP.
Bind it to localhost or a private network. Mass scanners find these within minutes of a host appearing online.
What commonly goes wrong
You can log in and the directory listing hangs
The classic two-channel symptom: the control connection on 21 worked, the data connection did not. Switch the client to passive mode, and on the server define a passive port range and open exactly that range in the firewall — plus tell the server its public address, or it advertises a private IP that the client cannot reach.
“425 Failed to establish connection” or transfers that stall at 0 bytes
Same fault from the other side, usually a stateful firewall without an FTP helper module rewriting the PASV reply. Many networks have deliberately disabled those helpers because they were a security problem in themselves. FTPS makes it worse — the firewall cannot read the encrypted PASV reply at all — which is another argument for SFTP.
Check port 21 yourself
No browser can open a raw TCP socket, so no web page can honestly tell you whether this port is open on a remote host. These are the real commands, generated for port 21 — swap example.com for the host you are actually testing.
Is port 21 reachable on another host?
nc -vz example.com 21"succeeded!" means the TCP handshake completed — the port is open. "Connection refused" is closed; a hang until timeout means filtered (a firewall dropped it silently).
nmap -Pn -p 21 example.comThe only common tool that distinguishes open / closed / filtered. -Pn skips the ping sweep, so it still works against hosts that ignore ICMP.
Test-NetConnection example.com -Port 21Read TcpTestSucceeded: True = open. It is built in — nothing to install.
telnet example.com 21A blank screen or a banner means it connected. "Connection refused" means closed. Quit with Ctrl-] then `quit`.
curl -v --max-time 5 telnet://example.com:21Handy when telnet is not installed: "Connected to …" proves the TCP handshake, without curl trying to speak HTTP.
What on this machine is holding port 21?
sudo ss -tlnp | grep :21Lists the listening socket and the PID/program holding it. Drop sudo and you get the socket but not the process name.
sudo lsof -i :21The macOS answer to "address already in use". Kill it with `kill -9 <PID>` once you are sure what it is.
netstat -ano | findstr :21The last column is the PID. Match it in Task Manager’s Details tab, or `taskkill /PID <pid> /F`.
No web page can tell you whether a port is open on a remote host
A browser cannot open a raw TCP socket — there is no API for it, by design. So a site that reports “port 3389 is OPEN on 203.0.113.10” is not checking from your browser; it is asking its own server to scan on your behalf. That works, but it means their server sees the host you asked about, scans from their address rather than yours, and answers a question about their network path, not yours.
We don't have a server here and won't pretend to. So this page does three honest things instead:
| Port | Proto | Service | What it is | Exposure | |
|---|---|---|---|---|---|
| 21 | tcp | FTP | File Transfer Protocol control channel.Cleartext passwords, endlessly brute-forced. Replace with SFTP. | Neverbrowser-blocked | |
| 1521 | tcp | Oracle DB | Oracle TNS listener.Never public; TNS poisoning and SID enumeration are trivial from outside. | Never | |
| 2121 | tcp | FTP alt | FTP moved off 21 to dodge scanners.Obscurity is not security — it is still cleartext FTP. | Never | |
| 2179 | tcp | Hyper-V VMConnect | Console access to Hyper-V virtual machines.Direct console to every VM on the host. | Never | |
| 2181 | tcp | Apache ZooKeeper | Cluster coordination and configuration store.Unauthenticated by default; the four-letter commands dump your cluster layout. | Never | |
| 11211 | tcp/udp | Memcached | In-memory cache.No authentication, and the record-setting 1.7 Tbps UDP amplifier. Bind to localhost. | Never |
http://host:port/ and times it. A connection that is established proves a socket is open; an instant refusal usually means nothing is listening; anything else is honestly reported as “can't tell”. Each attempt gives up after 2.5s.nc -vz example.com 443
nmap -Pn -p 443 example.com
telnet example.com 443
curl -v --max-time 5 telnet://example.com:443
This page cannot answer that, and neither can any other page — from your browser. Opening a TCP connection to an arbitrary host and port is not something JavaScript is allowed to do. Every “open port checker” that gives you a green tick is running the scan on their server. Which is fine, as long as you know what you are agreeing to: they learn which host and port you were worried about, and the answer they give you is about the route from their data centre — not from the internet as your users see it.
What to do instead
Run the check from outside your own network. Copy an nmap or nc line from the card above and run it from a machine that is not behind the same router — a phone on mobile data with a terminal app, a cheap VPS, a colleague's laptop. Running it from inside the LAN tests the LAN, not the internet, and will happily say “open” while the world sees nothing.
Then check the thing that is actually blocking it, in this order: the service is bound to0.0.0.0 and not 127.0.0.1 · the host firewall (ufw, firewalld, Windows Defender Firewall) · the cloud security group or the router's port-forward rule · and finally your ISP, which commonly blocks 25, 80 and 445 on residential lines whatever you configure.
What a browser genuinely can verify
One thing: that an HTTPS service answers. If what you actually want to know is “is my site up and how fast is it”, the latency test measures real round trips to a CORS-open URL. If the name doesn't resolve, or resolves somewhere unexpected, that is a DNS problem, not a port problem — and it is the more common cause of “my port is closed” than an actual firewall.
An IP address finds the machine; a port picks which program on it gets the traffic. TCP sets up a connection first — a handshake, ordered delivery, retransmission — which is why the web, email and SSH use it. UDP just sends the packet with no handshake and no guarantee it arrives, which is why DNS, video calls and games use it: late data is worse than lost data.
That difference is why a UDP port is so much harder to test. TCP either completes a handshake or it doesn't, so a tool can tell you. A UDP service that has nothing to say to an unexpected packet stays silent — and silence looks identical to a firewall dropping it.
The three ranges
0–1023Assigned by IANA to core services. On Unix, binding one needs root (or CAP_NET_BIND_SERVICE).1024–49151Registered by vendors for their applications. Any user can bind these — which is why every dev server lives here.49152–65535Never assigned. The OS hands these out as the SOURCE port of your outgoing connections. (Linux actually uses 32768–60999 by default.)Closed is not the same as filtered
Closed means the host answered: the packet arrived, nothing is listening, and you got an immediate refusal (a TCP RST). Filtered means nothing answered at all — a firewall dropped your packet in silence, so you wait for a timeout and learn nothing. The difference matters: closed proves the host is reachable and the port is free; filtered tells you only that something between you and it is discarding traffic.nmap reports the two separately. A browser cannot distinguish them, which is why this page reports a timeout as “can't tell” rather than guessing.
The one habit worth keeping
Bind services to 127.0.0.1 instead of 0.0.0.0 unless something outside the machine genuinely needs them, and reach them over SSH or a VPN. Every database on the never-expose list above ships with that advice, and the leaks all begin the same way: a default bind address, a cloud instance with a public IP, and a scanner that found it within the hour.
The blocked-port list this page uses is the WHATWG Fetch Standard's “bad port” table — the ports every browser refuses to connect to (Chrome calls it ERR_UNSAFE_PORT). Local probing is additionally gated by Chrome's Local Network Access permission, which replaced Private Network Access and ships in Chrome 142.
FAQ
Is FTP secure?
No. Credentials and data are transmitted in clear text, so anyone on the network path can read both. Use SFTP over SSH on port 22, or FTPS if a counterparty requires the FTP command set.
What is the difference between FTP, FTPS and SFTP?
FTP is the original cleartext protocol on 21. FTPS is the same protocol wrapped in TLS (990 implicit, or STARTTLS on 21), so it keeps the two-connection design. SFTP is unrelated — a file-transfer subsystem inside SSH on port 22, one connection, encrypted and key-authenticated.
What is port 20 for?
The active-mode data channel: the server connects from port 20 back to the client to move the bytes. Modern deployments use passive mode instead, where the server listens on a high port, so port 20 is rarely involved.