SSH configuration, privileges, service minimisation and logging. The eight steps that deliver the most protection on a server.
A freshly installed Linux server starts in reasonable shape, but without a few settings the attack surface is needlessly large. This list focuses on what reduces real risk rather than a full compliance checklist.
Password-based SSH is the first attack surface on most servers: an internet-facing port 22 receives continuous attempts.
PasswordAuthentication no, key authentication onlyPermitRootLogin noIf the server faces the internet, place a jump server or VPN in front so SSH is not directly exposed.
What does not run cannot be attacked. Check what listens (ss -tulpn) and stop what is unnecessary. Typical surplus: an old web server, a database that should only be local, duplicated monitoring agents.
A local firewall on every server, not just at the network edge. Deny by default, permitting only ports actually in use, with source restrictions where possible.
A database should never listen on 0.0.0.0 if only the application server reaches it.
Automatic patching on servers is debated, but practice shows an unpatched system is a greater risk than the rare update failure. A compromise: automatic security updates, manual version upgrades.
sudo rights for specific commands rather than blanket accesssudo usage loggedLocal logs are in the attacker's hands. System logs must be copied to a separate server or SIEM, because traces on the machine can be deleted. We covered this in detail in our logging article.
Minimum: authentication events, sudo usage, service starts, package installation.
A simple integrity checker (AIDE or similar) flags when a system binary or configuration changes. Run daily, with the report sent elsewhere rather than kept on the machine.
SELinux or AppArmor restricts what a process can do even when compromised. Disabling it is a common reflex during troubleshooting, and nobody re-enables it afterwards. Refining the policy is the better path.
If services run in containers, a few things change:
Our IT security services include establishing and reviewing server baselines.
Comprehensive IT security services including firewalls, WAF, IPS, SIEM, DLP and endpoint protection from…
Most incident investigations fail because the decisive log is missing or already rotated. Which sources to…
Why mandatory 90-day rotation is wrong, what the right length rule is, and how to roll out a password…
Our specialists are happy to discuss what this means in your organisation's environment.