Web Server Rescue
Read-only, can be slowCheck What Is Actually Listening
A service appears started, but you need to confirm whether anything is listening on the expected port.
Command
ss -tulpn | grep ':80\|:443'
Before you run this
System impact: Read-only. Can create load on large logs, directories, filesystems, or process tables.
When not to use it: Do not expose closed services just because a port is not listening; check config first. Inside containers, remember you are seeing that container's network namespace, not the host.
Expected output
Listening TCP or UDP sockets with local addresses, ports, and process names. The lab output shows a local test service on 8443; production web servers usually show 80 and/or 443.
System impact
Read-only, can be slow. Nothing changes. The command lists listening sockets and the owning process when available. The temporary shell lab uses an unprivileged local test service on port 8443 instead of binding 80 or 443.
Scope this to the smallest useful path or service on busy systems.
Recovery / rollback: no state is changed.
When to use it
Use this when debugging web server, API, SSH, or database connectivity. On real web servers, the production command filters for ports 80 and 443.
When not to use it
Do not expose closed services just because a port is not listening; check config first. Inside containers, remember you are seeing that container's network namespace, not the host.
Watch this command run
Command transcript
This sanitized transcript shows the commands and output shape without exposing host details.
$ ss -tulpn
Netid State Recv-Q Send-Q Local Address:Port Peer Address:PortProcess
tcp LISTEN 0 4096 *:8443 *:* users:(("openssl",pid=10,fd=3))
$ ss -tulpn | grep ':8443'
tcp LISTEN 0 4096 *:8443 *:* users:(("openssl",pid=10,fd=3))
$ curl -k -sS --max-time 2 -D - -o /dev/null https://localhost:8443/
HTTP/1.0 200 ok
Content-type: text/html
View commands shown
These are the commands shown in the sanitized transcript.
Commands shown
ss -tulpnss -tulpn | grep ':8443'curl -k -sS --max-time 2 -D - -o /dev/null https://127.0.0.1:8443/
next steps
Related commands
Find Listening Ports with ss
Before blaming the firewall, check whether anything is actually listening.
ss -ltnp
List Listening Ports on a VPS
Unexpected network listeners are first-response evidence.
ss -ltnp
List Listening TCP Sockets
Firewall rules matter after you know what is listening.
ss -ltnp
Show Published Container Ports
When a service is unreachable, confirm Docker is publishing the port you think it is.
docker port web
Your Site Is Not Down. DNS Might Be Lying.
The browser said the site was gone. The server was answering fine.
curl --resolve example.com:443:203.0.113.10 https://example.com/
Study mapping
Use this as independent command practice: read the notes, predict the output, then compare it with the example before using a real shell.
Useful for
- LPIC-1 style command-line practice
- LFCS style performance tasks
- Linux+ style troubleshooting review
Independent study support only. No affiliation, endorsement, exam dumps, or real exam questions.