Port 22 — SSH
Port 22/TCP carries SSH, and it is worth being precise about how much that one number covers: an interactive shell, file transfer (both scp and SFTP run inside SSH — the SFTP you want has nothing to do with port 115), and arbitrary port forwarding. That last capability is why an SSH account is worth more than a login: ssh -L 5432:localhost:5432 host turns a database bound to loopback into something reachable from a laptop, entirely legitimately.
Our reference marks 22 “expose with care”, and the reason is narrower than it sounds. The cryptography is not the weak point; the password prompt is. A host with PasswordAuthentication yes and a human-chosen password is being guessed against continuously, and one hit is a shell. With PasswordAuthentication no, PermitRootLogin no and a current OpenSSH, the port is doing its job — it was designed to face hostile networks.
Expect the noise either way. Any address with 22 open collects thousands of login attempts a day from botnets that scan the whole IPv4 space, and that is normal background radiation rather than a targeted attack. fail2ban and CrowdSec cut the log volume; they do not change whether key-only auth is the thing protecting you.
Port 22 at a glance
| Field | Value | Detail |
|---|---|---|
| Port | 22 | Well-known |
| Service | SSH | Secure shell — remote terminal, SFTP and tunnels. (TCP) |
| Category | Remote access | shells, desktops and VPNs |
| Exposure | Care | Expose with care |
Should port 22 face the internet? Safe only with keys, no password auth and no root login; it is scanned constantly.
Legitimately public in some setups, but only hardened — current version, real authentication, rate limits, and ideally an allow-list.
What commonly goes wrong
“Connection refused” vs “Operation timed out” — they are different faults
Refused means a machine answered and actively rejected the connection: the host is up and routable, but nothing is listening on 22 (sshd stopped, or it is bound to a different address). Timed out means the packet was silently dropped, which is a firewall or security group — the host may be perfectly healthy. Chasing a dropped packet by restarting sshd wastes an afternoon.
“Permission denied (publickey)” right after switching to key-only auth
Almost always file permissions rather than the key: OpenSSH refuses an authorized_keys file that is group- or world-writable, and it does so silently from the client’s point of view. Want ~/.ssh at 700 and authorized_keys at 600, owned by the login user. Run ssh -vvv to see exactly which keys were offered and where the server stopped, and check the server’s journal — it logs the real reason.
Check port 22 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 22 — swap example.com for the host you are actually testing.
Is port 22 reachable on another host?
nc -vz example.com 22"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 22 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 22Read TcpTestSucceeded: True = open. It is built in — nothing to install.
telnet example.com 22A 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:22Handy when telnet is not installed: "Connected to …" proves the TCP handshake, without curl trying to speak HTTP.
What on this machine is holding port 22?
sudo ss -tlnp | grep :22Lists the listening socket and the PID/program holding it. Drop sudo and you get the socket but not the process name.
sudo lsof -i :22The macOS answer to "address already in use". Kill it with `kill -9 <PID>` once you are sure what it is.
netstat -ano | findstr :22The 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 | |
|---|---|---|---|---|---|
| 22 | tcp | SSH | Secure shell — remote terminal, SFTP and tunnels.Safe only with keys, no password auth and no root login; it is scanned constantly. | Carebrowser-blocked | |
| 2222 | tcp | SSH alt | SSH moved off 22 — also DirectAdmin.Cuts log noise, not risk: the same key-only, no-root rules apply. | Care | |
| 4222 | tcp | NATS | NATS messaging server.Default configuration allows anonymous publish and subscribe. | Never | |
| 5222 | tcp | XMPP client | Jabber/XMPP client connections.Public chat servers are normal — require TLS and authentication. | Care | |
| 22000 | tcp | Syncthing sync | Syncthing’s data transfer port.Device-authenticated by design; the GUI (8384) is the part to keep private. | Care |
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 it safe to open port 22 to the internet?
Yes, if authentication is keys-only, root login is disabled and OpenSSH is current. SSH was built to be the internet-facing door — the breaches attributed to “port 22 was open” are nearly always guessed passwords or a reused key, not a break in the protocol.
Does moving SSH to port 2222 make it safer?
It removes most of the log noise and none of the risk. Scanning all 65,535 ports of an address takes seconds with modern tooling, so anyone targeting you finds it immediately. Move it if you want quieter logs; do not move it instead of disabling password auth.
Why does my SFTP client connect on 22 and not 115?
Because SFTP is a subsystem of SSH, not a descendant of FTP. It shares the SSH connection, the SSH host key and the SSH authentication. Port 115 belongs to a 1984 protocol called Simple File Transfer Protocol, which is unrelated and should not be listening anywhere.