Compliance

Linux Hardening Checklist: 30 Steps for Production Servers

A 30 step Linux hardening checklist built around safe change, exact platform state, recovery, and fresh proof from production servers.

Chris Seymour, Cofounder and Principal at Artemes AI
Chris Seymour
Cofounder, Principal
Sep 2, 2026 9 min read
Linux hardening loop from server role through approved state, safe change, effective state, and fresh evidence

Linux hardening does not fail because teams lack checklists. It fails because they change production state without proving what the server needs or what the change did.

A useful Linux hardening checklist starts with the server role, preserves a recovery path, removes capability, and reads effective state after every change. Thirty green boxes in a policy document mean nothing if an old service still listens on the public interface or the team cannot regain access after an SSH change.

The stakes are not theoretical. Verizon's June 2026 Data Breach Investigations Report release says vulnerability exploitation started 31 percent of breaches. That was the leading entry point for the first time in the report's 19 year history. A server with an unnecessary package, exposed listener, or late update gives that trend somewhere to land.

Infographic

A production hardening loop, not a one time checklist

Every control needs an owner, a safe change path, and fresh proof from the running server.

Linux hardening production control loopA five stage loop moves from system role to approved capability, controlled change, effective state, and evidence. Drift sends the server back through review instead of leaving an old pass result in place.Hardening is a closed control loop1. System rolePurpose and owner2. Approved stateNeeded capability3. Safe changeTest and rollback4. Effective stateRead the host5. Fresh evidenceTime and resultDrift, failed checks, or stale evidenceReturn to the role decision. Do not preserve an old pass.A hardened image is only the start. The running host supplies the proof.

What should Linux hardening accomplish?

Linux hardening should reduce the capability available to an attacker while keeping the workload supportable. That means fewer identities, packages, services, listeners, privileges, write paths, and hidden changes. It also means enough logging and recovery to explain what happened when a control fails.

Start from a maintained benchmark, then tailor it to a named role. The CIS Benchmarks guide explains how to select and version a profile. The system hardening pillar covers the wider operating model. This checklist handles the Linux decisions that turn those documents into production state.

How should you prepare a Linux server before changing it?

  1. Name the role and owner. Record the workload, business owner, technical owner, data class, exposure, management plane, recovery target, and expected retirement. An unnamed server attracts permanent exceptions.
  2. Inventory installed capability. Capture packages, kernel, modules, services, timers, sockets, containers, accounts, sudo rules, mounts, repositories, and scheduled jobs. Compare the image manifest with the running host.
  3. Map every reachable service. Read local listeners with ss, then test allowed and denied paths from outside the host. A process bound to all interfaces is a decision, not background noise.
  4. Capture current state. Save effective configuration, package versions, firewall rules, security module mode, boot state, and benchmark results with a timestamp. This is your comparison point, not proof that the state is safe.
  5. Build rollback first. Verify console access, snapshot or rebuild path, configuration backup, service health check, and named rollback owner. Do not test remote access controls without a second path into the machine.
sudo ss -lntup
systemctl list-unit-files --state=enabled
sudo nft list ruleset
sudo aa-status
getenforce

Run the commands that match the distribution. AppArmor is common on Ubuntu. SELinux is common on Red Hat systems. An error because a control is absent is useful evidence. Do not convert it into a pass.

Which identity and remote access controls matter first?

  1. Remove stale accounts. Disable unused human and service accounts, confirm ownership, inspect dormant authorized keys, and set an expiry for temporary access.
  2. Separate administration. Give operators named accounts and elevate only for administration. Keep workload identities unable to log in unless their job requires an interactive session.
  3. Harden SSH in stages. Prove key access, restrict allowed groups and sources, validate the file, open a canary session, then disable direct root and password access. The SSH hardening guide gives a tested configuration and reload sequence.
  4. Constrain sudo. Replace broad grants with commands tied to a role. Log elevation, prohibit shared administrator accounts, and review included files as well as the main sudoers file.
  5. Reduce service identity rights. Set a non login shell, narrow file ownership, remove unused group membership, and keep secrets outside command lines and world readable environment files.

How do you cut package and service risk?

  1. Use a supported release. Record the distribution, stream, support end date, kernel source, and update channel. A patched end of life host is still outside a reliable repair process.
  2. Trust fewer repositories. Remove abandoned sources, verify signing configuration, restrict who can add a repository, and alert when package origin changes.
  3. Remove unused packages. Start with compilers, interpreters, network clients, discovery tools, and server packages that the role does not need. Keep a reason for anything retained.
  4. Disable and mask unused services. A stopped unit can return after a dependency or package update. Disable ordinary services. Mask only when the role should never start them.
  5. Verify package and image integrity. Compare important files with the package database or signed image manifest. Route unexpected local files to an owner instead of deleting them blindly.

Ubuntu's current server documentation says unattended-upgrades is installed by default and runs once per day. That is a useful starting point, but production teams still need staged rings, reboot ownership, failure alerts, and proof that a host did not fall behind. Automatic download is not verified patching.

Which network controls belong in a Linux hardening checklist?

  1. Set a default deny host firewall. Allow the workload and management paths by source, protocol, and port. Test IPv4 and IPv6. Keep the console open until the rule set is proven.
  2. Bind management services narrowly. Prefer a management address, private interface, broker, or access proxy. Public reachability should be a documented exception.
  3. Inspect container publishing. A container runtime can add network rules or publish a port the host policy did not anticipate. Compare container definitions, kernel rules, and an outside scan.
  4. Protect name and time sources. Use approved DNS and time services, restrict configuration changes, and alert on drift. Authentication and audit evidence both depend on accurate time.
  5. Control outbound paths. Limit servers that do not need arbitrary internet access. Preserve update, identity, logging, backup, and application destinations, then verify denial from the workload context.

Canonical's official Ubuntu firewall documentation verifies the ufw syntax and warns that the tool starts disabled. Enabling a firewall is not enough. The allowed rules and outside test are what prove the boundary.

How should you harden the kernel, files, and workloads?

  1. Enforce application confinement. Keep SELinux or AppArmor in enforcing mode, review denials, and write the smallest exception that restores the business function. Permissive mode is a diagnostic step, not an ending.
  2. Set mount behavior by role. Use options such as nodev, nosuid, andnoexec only where workload tests support them. Verify the effective mount, not just fstab.
  3. Apply kernel settings with a threat reason. Version files under /etc/sysctl.d, test network and container behavior, and read values from /proc/sys after reload and reboot. Use the Linux kernel hardening guide to evaluate sysctls, module policy, Linux Security Modules, and lockdown as one controlled release.
  4. Protect the boot chain. Use Secure Boot where supported, restrict firmware and boot loader changes, control kernel command line arguments, and retain a tested recovery path for signed module failures.
  5. Constrain each workload. Use systemd sandbox settings, container capability drops, read only filesystems, resource limits, and separate identities where the application supports them. Measure before and after behavior.

Ubuntu 26.04 LTS, released in 2026, made TPM backed disk encryption generally available, ships OpenSSH 10.2, removed DSA support, and changed several identity services to run with less privilege. Its Apache package now disables TLS 1.0 and 1.1 by default. The Ubuntu 26.04 security release notes are a good reminder that a baseline must follow the exact platform release. Old advice can preserve a setting the distribution already replaced.

How do logging, recovery, and verification close the loop?

  1. Centralize material logs. Send authentication, privilege, service, security module, package, firewall, and workload events off the host. Alert when expected sources stop reporting.
  2. Audit sensitive change. Watch identities, privilege files, SSH policy, security controls, scheduled execution, package sources, and application configuration. Tune around decisions, not file noise.
  3. Test backup and recovery. Protect backup credentials from the host, restore into an isolated environment, and prove the recovered system has the expected hardening state.
  4. Run a version matched benchmark. Scan before and after change, store raw results, document tailoring, and separate collection failure from control failure. Never remediate a production fleet from a score alone.
  5. Monitor drift and evidence age. Recheck material controls after deployment, reboot, package change, image update, and on a fixed cadence. A server that stopped reporting is unknown, not compliant.

NIST's official Linux hardening example for SP 1800-35 uses OpenSCAP to inspect a profile before applying remediation. The syntax below follows that guidance. Replace the placeholder with content built for the exact distribution and version.

oscap info /path/to/profile.xml
oscap xccdf eval --profile xccdf_org.ssgproject.content_profile_stig --results results.xml /path/to/profile.xml

What does poor Linux hardening cost?

Take 1,200 servers and a 160 rule baseline. That creates 192,000 observations. Even a 97 percent pass rate leaves 5,760 differences. At four minutes to inspect each one, the queue costs 384 analyst hours before a single fix is deployed. A raw compliance score turns skilled labor into a counting exercise.

Group by shared cause and consequence instead. If 3,400 differences came from one old image, repair the image, rebuild a test host, and verify the fleet result. If ten findings expose remote administration to the internet, route those ten now. The security misconfiguration guideshows how exposure and privilege change the order.

Which Linux hardening mistakes break production?

The first mistake is copying a generic sysctl file into every role. The second is disabling SSH before proving another session. Another common failure is applying a benchmark's automated repair without reading impact notes. Database memory, container namespaces, directory identity, backup mounts, and service discovery all collide with controls that look harmless on paper.

Changing the SSH port is not a primary defense. Installing another scanner is not proof. Running a one time audit on the image is not fleet verification. The job is to make each reduction repeatable, observable, and reversible enough that operations will keep it in place.

Frequently asked questions

What is the first Linux hardening step?

Define the server role and preserve a recovery path. Then inventory identities, services, packages, listeners, and management controls before changing them. You need to know what the workload requires and how to recover access.

Should every Linux server use the same benchmark profile?

No. Use a common policy source, then tailor by distribution, version, role, exposure, and obligation. A public web server, container host, database, and developer workstation need different capability.

Can Linux hardening be automated?

Yes, after the policy and test are sound. Automate observation first, then controlled deployment, verification, and rollback. Keep changes that can deny access or stop a workload behind staged approval. The hardening automation guide provides the canary, evidence, and exception workflow.

How often should Linux hardening be checked?

Check material controls after image and package changes, after reboot, and on a cadence tied to server risk. Track evidence age continuously so a silent host cannot keep an old pass result.

The executive takeaway

Choose one production role this week. Capture its effective state, preserve console recovery, remove one shared source of unnecessary capability, and prove the result from the host and the network. Deep endpoint context with AI driven analysis can connect a failed control to actual exposure and an exact repair, but ownership and rollback still belong to the team. A hardened server is a maintained state, not a score from last quarter.

Artemes AI

Put more evidence behind vulnerability decisions

Artemes AI combines endpoint telemetry, sourced vulnerability intelligence, and analysis with practitioner review so teams can examine the evidence, missing context, and recommended next step together. We are accepting early access requests now.

Chris Seymour, Cofounder and Principal at Artemes AI

Chris Seymour

Cofounder, Principal

Chris writes about vulnerability prioritization, exploitability, remediation supported by AI, and the engineering realities of turning scanner output into remediation decisions.

Blue Team
Security Automation
Endpoint Telemetry
Found this useful? Share it.

Get articles like this in your inbox.

Security research and occasional Artemes AI product updates.