Harden a Linux box in minutes.
Undo it in seconds.

CIS-aligned security automation for Debian, RHEL, Arch, SUSE, Alpine, Void, Gentoo and NixOS, plus macOS and the BSDs. 23 hardening modules, a preview mode that shows every change before it happens, and a full revert path for when something goes wrong.

v2.6.4 ShellCheck clean 23 modules 26 platforms MIT licensed OpenSSF Best Practices: passing No telemetry
Try it in your browser Compare tiers View source on GitHub
root@server β€” ultimate_hardening.sh --dry-run
$ git clone --branch v2.6.4 https://github.com/Kal1010101/ultimate-sys-hardening.git $ cd ultimate-sys-hardening $ sudo ./src/free/ultimate_hardening.sh --dry-run ╔══════════════════════════════════════════════════════════════════╗ β•‘ ULTIMATE HARDENING 2.6.4 β€” FREE TIER β•‘ β•‘ Platform: rhel β•‘ β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β• ⚠️ DRY RUN β€” nothing will be modified [enable ] already in place [disable] not applied yet [ N/A ] not applicable here 1) System updates (Safe) [enable ] 2) SSH hardening (Medium) [enable ] 3) Firewall (Medium) [enable ] 4) Fail2Ban (Safe) [enable ] 5) File permissions (Safe) [enable ] 6) Kernel & network (Safe) [enable ] 7) Audit daemon (Safe) [enable ] 8) Password policy (Safe) [enable ] 9) SUID/SGID hardening (High) [disable] 10) AIDE file integrity (Safe) [disable] 11) Rootkit scanner (Safe) [enable ] 12) Disable unused services (Safe) [disable] 13) AppArmor / SELinux (Medium) [enable ] 14) /etc version control (Safe) [enable ] 15) Boot security (Safe) [enable ] 16) GRUB password (High) [ N/A ] 17) Docker security (Medium) [ N/A ] 18) ModSecurity WAF (Medium) [ N/A ] 19) Disable unused kernel modules (Safe) [disable] 20) Compiler access restriction (Medium) [disable] 21) Remote syslog (Safe) [disable] 22) UMASK hardening (Safe) [enable ] 23) Base system (shm, time, sudo) (Medium) [enable ] 24) Apply all Safe/Medium modules (skip High risk) 25) Apply all 23 modules (includes High risk) C) Run compliance checks (read-only) R) Revert everything from backup Q) Quit

See the real screenshots or what Pro adds (coming soon).

What it does

Twenty-two modules, one menu

Every module is individually selectable, risk-labelled, and shows a live [enable ] / [disable] status derived from the compliance checks, so you can see what is already in place before you touch anything.

πŸ”’ SSH & access

Root login, password auth, empty passwords, X11 and TCP forwarding, MaxAuthTries, login grace and keepalives — validated with sshd -t before restart. Plus GRUB password protection.

πŸ”₯ Network

nftables, UFW or firewalld firewall, Fail2Ban, sysctl network hardening, unused protocol blacklisting, remote syslog.

πŸ“‹ Auditing

auditd rule sets, AIDE file integrity, rkhunter rootkit scanning, etckeeper change tracking.

βš™οΈ Kernel & filesystem

ASLR, hardlink/symlink protection, SUID/SGID reduction with per-binary backup, UMASK 027 defaults.

πŸ›‘οΈ Mandatory access control

AppArmor profile enforcement on Debian family, SELinux enforcing mode on RHEL family.

🐳 Workloads

Docker daemon hardening, ModSecurity WAF, USB storage blocking, compiler access restriction.

See it

The screens, not pictures of the screens

The module states and check results are demo values β€” the layout, ordering, risk levels, remediation hints and score arithmetic are the real thing. To click through every menu choice with output recorded from a real run, try the interactive replay.

platform selection
╔══════════════════════════════════════════════════════════════════╗ β•‘ SELECT YOUR OPERATING SYSTEM / DISTRO β•‘ β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β• Linux 1) Debian / Ubuntu / Mint / Kali / Raspbian 2) RHEL / CentOS / Fedora / Rocky / Alma / Amazon 3) Arch / Manjaro / EndeavourOS / Artix 4) openSUSE / SLES 5) Alpine 6) Void 7) Gentoo 8) NixOS Unix / BSD (partial coverage) 9) macOS 10) FreeBSD 11) OpenBSD 12) NetBSD 13) Solaris 0) Auto-detect (recommended)

Eight Linux families and five Unix/BSD systems, or auto-detect.

ultimate_hardening.sh --cis-only
πŸ“Š Running CIS-aligned compliance checks (read-only)
βœ… /home is a separate partition
βœ… /tmp is a separate partition
⚠️ /var is a separate partition β€” Not a separate mount point β€” Not automated β€” separate partitions are an OS-install-time decision, not something a running system can safely repartition
⚠️ /var/log is a separate partition β€” Not a separate mount point β€” Not automated β€” separate partitions are an OS-install-time decision, not something a running system can safely repartition
⚠️ /var/tmp is a separate partition β€” Not a separate mount point β€” Not automated β€” separate partitions are an OS-install-time decision, not something a running system can safely repartition
βœ… SSH root login disabled
βœ… SSH password authentication disabled
βœ… SSH X11 forwarding disabled
βœ… SSH empty passwords rejected
βœ… SSH MaxAuthTries is 3 or fewer
βœ… auditd is running
βœ… fail2ban is running
βœ… Firewall is active
βœ… ASLR fully enabled
βœ… IP forwarding disabled
βœ… TCP SYN cookies enabled
βœ… Kernel log restricted to root
βœ… Kernel pointers hidden
βœ… SUID core dumps disabled
βœ… Password max age is 90 days or fewer
βœ… /etc/passwd permissions are 644 or stricter
βœ… /etc/shadow permissions are 640 or stricter
βœ… /etc/group permissions are 644 or stricter
βœ… /etc/gshadow permissions are 640 or stricter
βœ… Mandatory access control is enforcing
══════════════════════════════════════════════════════════════════
CIS Score: 88% (22/25 checks passed)
⚠️ 3 check(s) need attention
══════════════════════════════════════════════════════════════════

Read-only. Every failure names the module that fixes it.

Why you can run this as root

Built to be undone

This script rewrites SSH config, firewall rules and file permissions on your machine. That is a lot of trust to ask for, so every destructive action has a way back.

πŸ‘οΈ Preview before you commit

--auto-mode --dry-run prints every change the script would make and modifies nothing; --dry-run alone previews from the menu. Run it first, every time.

πŸ’Ύ Automatic backups

Modified files are copied to a timestamped /root/hardening_backup_* directory before any edit, including original SUID/SGID permission modes.

↩️ Full revert

--revert restores from backup; --revert-suid rolls back only permission changes. Revert auto-finds the most recent backup.

🧬 PAM-safe by design

Password policy is set in /etc/login.defs only. Nothing under /etc/pam.d is ever modified.

πŸ“‘ No telemetry, no phone-home

Nothing is ever sent anywhere about your hosts. In the free tier the only outbound traffic is the optional, explicitly-invoked update check against the GitHub API, which asks for the latest release and this project's published security advisories. The paid tiers can additionally download public vulnerability data β€” your distro's security feed, and the CISA KEV and EPSS lists β€” but only when you pass --cve-feeds or --cve-enrich, which are off by default. Those are inbound fetches of public files; no query carries anything identifying. Enterprise GitOps fetches policy only from the git repository you name.

πŸ” Readable and reviewed

Plain Bash, MIT licensed, ShellCheck-clean in CI on every push, tested in fresh containers on 10 distros across the Debian, RHEL, Fedora, Arch and Alpine families.

The PAM-safety guarantee exists because it once went wrong. An earlier version edited /etc/pam.d/common-password directly. On a Mint box running KDE Plasma, a later pam-auth-update run reconciled around that untracked edit and broke the SDDM login. The fix was to stop modifying PAM altogether, which is why the current release sets password policy in /etc/login.defs instead.
Standards

Aligned, mapped, and independently assessable

Being precise here matters more than sounding impressive, so here is exactly what each claim means.

πŸ“Š CIS-aligned

Built-in checks follow CIS Benchmark guidance for Linux. This is alignment, not a CIS certification, and the built-in scorer is not an accredited assessment.

🎯 OpenSCAP scanning EnterpriseComing soon

Runs oscap against the official SCAP Security Guide, so you get a real, assessable result under a CIS or DISA STIG profile β€” not the tool's own interpretation of one.

πŸ—ΊοΈ NIST 800-53 crosswalk EnterpriseComing soon

Maps each hardening module to the NIST SP 800-53 Rev. 5 controls it contributes to, and reports how many are in place on this host right now. Exports to JSON and CSV, and appears in the HTML compliance report. A mapping and a configuration record β€” not an assessment, and not a claim of compliance.

What this is not. The crosswalk explains which controls a module contributes to; it is not an assessment result and not a certification. For an auditable CIS or STIG score, use the OpenSCAP scan against official SCAP content β€” that is what assessors recognise.
Pricing

The core hardening is free. The fleet management isn't.

What costs money is everything around the hardening: proving the work happened, repeating it on a schedule, and doing it across more machines than you can log into by hand. One server and an evening? The free tier's 23 modules are the same engine the paid tiers run on.

What the paid tiers add The Pro menu keeps all 23 free modules and adds a second panel. Nothing is taken out of the free tier.
Open source

Free

$0
Built for a single machine
MIT licensed. No account, no signup.
  • All 23 hardening modules
  • Interactive menu with live status
  • Built-in CIS benchmark checks
  • Dry-run preview mode
  • Automatic backup & full revert
  • 26 platforms β€” 8 Linux families, macOS and the BSDs
  • Community support via GitHub
Get it on GitHub
Coming soon

Pro

$9 /month
or $79 /year Β· save 27%
One admin, many machines
Single admin, up to 10 hosts (your own or your clients').
  • Everything in Free
  • One-command auto-fix of CIS findings
  • HTML compliance reports
  • Security posture: open ports, failed logins, active services
  • 3 extra hardening modules: SSH rate limiting, sshd resource caps, USB device control
  • Exception register: waivers with a justification and review date
  • Intrusion activity report & new-ban alerts
  • Compromise indicator scan with a baseline & scheduled email alerts
  • Asset inventory & SBOM export (CycloneDX / SPDX)
  • CVE exposure report for the installed packages
  • AI directory lock-down
  • Scheduled runs (daily/weekly/monthly)
  • Email & SMTP alerting
  • Config-file driven runs
  • Email support
Get notified
Coming soon

Enterprise

$49 /month
or $490 /year Β· save 17%
A fleet someone audits
Up to 10 hosts, then $3/host/month. Flat $149/month up to 50 hosts.
  • Everything in Pro
  • Multi-host compliance dashboard
  • OpenSCAP scanning β€” CIS, DISA STIG, and PCI-DSS / HIPAA / ANSSI where your distro ships the profile
  • NIST SP 800-53 Rev. 5 crosswalk β€” with JSON/CSV export
  • YAML policy-as-code & drift detection
  • GitOps policy delivery with signed approvals and host tags
  • Remote deployment over SSH
  • Fleet compromise-scan view & remote scans over SSH
  • Run history export (JSON / CSV)
  • SQLite state history & trend tracking
  • Fleet-wide syslog: one collector, every host
  • Priority support
Get notified

Full comparison

CapabilityFreePro (coming soon)Enterprise (coming soon)
Hardening modules232323
Dry-run & full revertβœ“βœ“βœ“
Built-in CIS checksβœ“βœ“βœ“
CIS results as JSON / SARIF (--json, --sarif)βœ“βœ“βœ“
Skip single settings (UH_SKIP_SETTINGS)βœ“βœ“βœ“
One-step fix for each failed CIS check (Free applies all 23 modules)β€”βœ“βœ“
HTML compliance reportβ€”βœ“βœ“
Posture: ports, logins, servicesβ€”βœ“βœ“
Extra hardening modules (SSH rate limiting, sshd resource caps, USB device control)β€”33
Exception register (waivers)β€”βœ“βœ“
Intrusion activity & new-ban alertsβ€”βœ“βœ“
Compromise indicator scan, baseline & scheduled emailβ€”βœ“βœ“
Asset inventory & SBOM exportβ€”βœ“βœ“
CVE exposure reportβ€”βœ“βœ“
AI directory lock-downβ€”βœ“βœ“
Scheduled runs & email alertsβ€”βœ“βœ“
OpenSCAP CIS / STIG scanβ€”β€”βœ“
NIST 800-53 crosswalkβ€”β€”βœ“
Policy-as-code & drift detectionβ€”β€”βœ“
GitOps delivery, signed approvals, host tagsβ€”β€”βœ“
Multi-host dashboardβ€”β€”βœ“
Remote SSH deploymentβ€”β€”βœ“
Fleet compromise-scan view & remote scanβ€”β€”βœ“
Run history export (JSON / CSV)β€”β€”βœ“
Remote syslog forwardingβœ“βœ“βœ“
Fleet-wide syslog (one collector, pushed on deploy)β€”β€”βœ“
SupportCommunityEmailPriority

πŸ”“ What you are actually paying for

The 23 modules in Pro and Enterprise are the same code the free tier runs. Nothing is removed or crippled to make the paid tiers look better β€” open the Pro menu above and all 23 free modules are sitting there above the paid panel. What you buy is the operational layer: evidence, repetition and scale, plus a few extra hardening modules. It also means the free tier cannot be quietly degraded to drive upgrades, because the paid tiers are built on it.

↩️ If you stop paying

The Pro/Enterprise licence ends at the end of the paid period and you stop running that software. The free tier keeps working under MIT, unaffected. Hardening already applied stays applied, and --revert still works β€” both live in the free tier.

Honest scope notes. CIS-aligned is not CIS-certified. The built-in checks follow CIS guidance but are not an accredited assessment; the Enterprise OpenSCAP scan runs against official SCAP content for an auditor-recognised result. The NIST crosswalk is a mapping, not an assessment. It records which modules contribute to a control and how many are in place here. A control is satisfied by policy, procedure and evidence across a whole system; this is one input to that, not the answer. Host counts are honest. Remote deployment is sequential SSH, suited to tens of hosts, not thousands. Fleet-wide syslog configures forwarding to a collector you run; it is not a log aggregation product. This is a root-privileged tool that edits live configuration. Two modules are marked High risk because SUID stripping and GRUB passwords can leave a machine unbootable. Use --dry-run first, and --safe-only to apply everything except those two.
Questions

FAQ

Will this break my server?

It can β€” any real hardening tool can, which is why the safety design matters. Run --dry-run first to see every change, keep the automatic backups, and use --revert if something misbehaves. The two High-risk modules (SUID stripping, GRUB password) are labelled: the menu asks before applying them, and --safe-only leaves them out of an --auto-mode run. Without it, --auto-mode includes SUID stripping; the GRUB password always needs you at the keyboard.

Does it work over SSH without locking me out?

SSH hardening disables root login and password authentication. If you connect as root with a password and no key, you will lock yourself out. Set up key-based access for a non-root sudo user first, and preview with --dry-run before applying.

Is this CIS certified?

No, and anything claiming otherwise deserves scrutiny. The built-in checks are CIS-aligned. For an assessable, auditor-recognised CIS or DISA STIG result, the Enterprise tier runs OpenSCAP against the official SCAP Security Guide content.

What distributions are supported?

Eight Linux families: Debian/Ubuntu/Mint/Kali/Raspbian, RHEL/CentOS/Fedora/Rocky/AlmaLinux/Amazon, Arch/Manjaro/EndeavourOS/Artix (Artix untested), openSUSE/SLES, Alpine, Void, Gentoo and NixOS. Artix is treated as Arch but runs without systemd, so it has not been tested. FreeBSD, OpenBSD, NetBSD and Solaris are detected and adapted, with thinner coverage. On macOS it runs the read-only checks and the dry run only; applying hardening there is not supported yet (it needs bash 4 or newer: brew install bash). The script detects your distro or lets you select it, and adapts package manager and service names accordingly.

Does it send any data anywhere?

No. There is no telemetry, analytics or licence phone-home, in any tier β€” nothing about your hosts leaves them. In the free tier the only outbound request is the optional update check you invoke yourself from the menu, which asks the public GitHub API for the latest release and for this project's published security advisories. Everything else is local.

The Pro and Enterprise CVE features default to your own package manager's repository metadata, so they need no new network access at all. Two optional flags will download public files if you ask for them β€” --cve-feeds for your distro's security feed, --cve-enrich for the CISA KEV catalogue and EPSS scores. Both are off unless passed, and both are plain downloads: nothing is uploaded, and the request contains no host identifier, package list or licence key.

Enterprise GitOps (--gitops) clones and fetches policy from the git repository you point it at, and nowhere else.

The free tier is MIT-licensed β€” source is on GitHub.

How will Enterprise host counting work?

Enterprise is coming soon. A host is any machine you scan, harden or track in the dashboard. The base tier covers 10 hosts, additional hosts are $3/month each, and the flat $149/month plan covers up to 50. Above that, get in touch and I will size it.

Can I try Pro before buying?

Pro is coming soon; once it launches, get in touch and I will set up a trial. The free tier is also a genuine product rather than a crippled demo, so you can validate the hardening itself before paying for the automation layer.

Start with a dry run

Clone it, preview every change it would make, and decide from there. It costs you one command.

quick start
$ git clone --branch v2.6.4 https://github.com/Kal1010101/ultimate-sys-hardening.git $ cd ultimate-sys-hardening $ sudo ./src/free/ultimate_hardening.sh --dry-run # or try it in a throwaway container, with nothing on your machine touched: $ docker run --rm -it ubuntu:24.04 bash -c "apt-get update -qq && apt-get install -y -qq git ca-certificates openssh-server >/dev/null && git clone --branch v2.6.4 https://github.com/Kal1010101/ultimate-sys-hardening.git && cd ultimate-sys-hardening && ./src/free/ultimate_hardening.sh --dry-run"