Back to commands

Web Server Rescue

Read-only, can be slow

Check 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.

demo@lab:~$

$ 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

  1. ss -tulpn
  2. ss -tulpn | grep ':8443'
  3. curl -k -sS --max-time 2 -D - -o /dev/null https://127.0.0.1:8443/

next steps

Related commands

Cybersecurity Triage Read-only

Find Listening Ports with ss

Before blaming the firewall, check whether anything is actually listening.

ss -ltnp
Web Server Rescue Read-only

Show Published Container Ports

When a service is unreachable, confirm Docker is publishing the port you think it is.

docker port web
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.

  • lpic1:103-gnu-unix-commands
  • lpic1:109-networking
  • lfcs:essential-commands
  • lfcs:networking
  • lfcs:services-logs
  • linuxplus:automation-scripting
  • linuxplus:provisional
  • linuxplus:troubleshooting
  • risk:read-only

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.