Probe a closed port
Quest: probe-closed-port
Mission
Probe your assigned backend port with nc after a controlled stop. Explain the actual result, even if it is unexpectedly open.
Commands You Will Use
nc
Steps
- In your own classroom SSH account, compute the assigned port below. If it exceeds
65535, stop and ask staff; do not pick another port. - Identify your process and listener before changing anything. Stop only your known foreground server with
Ctrl-Cin its terminal. If ownership is unknown, ask staff and do not stop or kill the process. - From another SSH shell on the same classroom machine, compute
PORTagain in that shell and run the bounded probe below while your backend is stopped. - Read the actual output and explain what it establishes, not what you hoped it would say.
PORT="$((10000 + $(id -u)))"
printf '%s\n' "$PORT"
Only after confirming the assigned port is valid:
nc -vz -w 3 127.0.0.1 "$PORT"
The numeric loopback endpoint is on the classroom machine, not your laptop. -z probes the TCP connection without sending HTTP; -v reports the result and -w 3 bounds the wait.
Hints
- Refusal means the connection was rejected, consistent with no listener after your controlled stop. There is no HTTP status.
- Timeout means no connection completed within the wait; it is not proof of a closed port. Report it separately and ask staff about the unexplained result.
- Unexpected success means a listener accepted the connection, not that the correct web page works. Compare your own process and listener information with staff; do not kill an unknown process to force a failure.
Restore The Original Service
If you stopped your manual server, relaunch its original command in its original terminal, using the same assigned port and root; see Serve a local check page. If the port is unexpectedly occupied, ask staff to help restore the original service safely rather than starting a competitor.
Repeat local curl to confirm recovery and report any unresolved problem. Do not leave a deliberately stopped managed service behind. If no service was running before the probe, there is nothing to restore.
If Check Fails
Include the observed refusal, timeout, or unexpected open result and explain why that observation supports your diagnosis, or what remains unknown. A keyword list or forced failure is not an explanation.

Linux Foundations