0 Linux Account Hygiene - Stopping Insider Threats Before They Start - kevwells.com

Linux Account Hygiene – Stopping Insider Threats Before They Start

The Problem

Stale accounts are goldmines for attackers. Contractors leave, interns move on, yet their SSH keys and sudo rights linger.


Practical Checklist

  1. Regular Account Review
    awk -F: '{ print $1 " " $3 }' /etc/passwd | sort -n -k2

    → identify unused accounts.

  2. Disable, Don’t Delete
    usermod -L accountname

    → preserves forensic history.

  3. SSH Key Hygiene
    Remove stale keys from ~/.ssh/authorized_keys.
  4. Centralised Identity
    Use LDAP/AD or SSSD for joiners/leavers process.

Applied Example

  • A former contractor’s SSH key left active → attacker gained entry months later.
  • Regular review and automation (ansible.builtin.user module) closes this risk.

Why Clients Care

  • Insider threat accounts for 20–30% of breaches.
  • HR compliance requires documented leaver processes.
  • Clean account hygiene reduces audit findings and attack surface.

Security gaps in Linux and cloud systems risk downtime, data compromise, lost business — and compliance failures.

With 20+ years’ experience and active UK Security Check (SC) clearance, I harden Linux and cloud platforms for government, corporate, and academic sectors — ensuring secure, compliant, and resilient infrastructure.