How do you remove unnecessary attack surface on a server?
BeginnerProductionSSH & Access Hardening
Answer
ss -tulnp # what is listening?
systemctl list-unit-files --state=enabled # what starts at boot?
sudo systemctl disable --now cups avahi-daemon rpcbind
sudo apt purge telnet rsh-client # or dnf remove
Start from a minimal image, install only what the role needs, and bind internal services (Redis, metrics, admin UIs) to 127.0.0.1 or a private interface.
More on SSH & Access Hardening
What are the first sshd_config changes you make on a new production server?BeginnerWhy use a drop-in file in /etc/ssh/sshd_config.d/ instead of editing sshd_config?IntermediateWhy disable SSH password authentication entirely?BeginnerShould you change the SSH port from 22?IntermediateWhat are SSH certificates and why do large fleets use them?AdvancedHow do you restrict what a specific SSH key can do?Advanced