What it means
Refused means a fast, explicit "no": the TCP SYN reached the host and got a reset. Nothing listens on that port, or the service listens only on 127.0.0.1 and you came from outside. A timeout instead means packets are dropped on the way (a firewall).
Causes and fixes
Most likely first. Run the check, and if it matches, apply the fix.
1. The service isn't running or crashed
Check:
systemctl status <svc>; ss -ltn
Fix: Start it and read its logs for why it stopped.
2. The service listens only on loopback (127.0.0.1)
Check:
ss -ltnp | grep <port> # 127.0.0.1:<port> vs 0.0.0.0:<port>
Fix: Bind to 0.0.0.0 (or the right interface) in its configuration, and firewall what shouldn't be public.
3. Wrong port, or the wrong host/IP
Check:
nc -zv <host> <port>
Fix: Connect to where the service actually listens.
Fix it yourself
A live machine in your browser with this problem already on it. The grader checks the result.
- Listen on All Interfaces, Not Just Loopbackeasy 4 min
- A Port Check That Tells the Differencemedium 11 min
- Which Ports Are Exposed?medium 8 min
No account needed for your first tries.
Related errors
- bind: address already in use
Another process (often an old copy of the same one) already listens on that port.
- Service has no endpoints
The Service exists, but its selector matches no ready Pods, so connections fail.