Interview Prep/Linux/Security, hardening and incident response

An auditor asks you to prove which ports are open on a server and why. How do you produce that?

BeginnerScenarioSecurity, hardening and incident response
Answer

Situation read → Show listening sockets and map them to services and firewall rules.

What I'd do →

sudo ss -tulpn
sudo firewall-cmd --list-all       # or: sudo nft list ruleset / sudo ufw status verbose
nmap -sT -p- server01              # from another host, what's actually reachable

Document each port with its owning service and business reason; close anything without one.

Why → ss shows what listens; the external nmap shows what is exposed after firewalls.

Interview tip → Distinguish "listening on 127.0.0.1" from "listening on 0.0.0.0".

All Linux questions Roadmap: Linux

More on Security, hardening and incident response