Lockdown Lab #7 CRITICAL Linux (Ubuntu/RHEL)

Enforce SSH key-based authentication

Enforce SSH key-based authentication

Let’s talk about the lowest hanging fruit for botnets: password-based SSH. If you’re still allowing it, you’re not just leaving a door open; you’re putting out a welcome mat for Mirai and its cousins. This isn’t theoretical; it’s the number one vector for automated attacks.

The 2024 XZ Utils backdoor attempt underscored how critical defense-in-depth is, especially for foundational services. Password authentication for SSH is archaic and dangerous, especially when public key infrastructure is so readily available and secure.

The fix is simple, effective, and mandatory. Disable password authentication entirely.

In your sshd_config: PasswordAuthentication no PubkeyAuthentication yes

Then restart your SSH daemon: sudo systemctl restart sshd

If you’re not doing this, you’re operating with a critical vulnerability that’s easily exploitable. This is basic hygiene, not advanced security.

Go check your configs. Now.

The fix

# /etc/ssh/sshd_config

PasswordAuthentication no

PubkeyAuthentication yes

# Restart sshd

sudo systemctl restart sshd

Reference: CIS Linux Benchmark 5.2.12

Mark this as done

Open the interactive hardening checklist and tick this off in your environment.

Open interactive checklist →

Related Posts

Ship logs to remote syslog / SIEM

Think an attacker won't erase their tracks? They will. Every single time. If your logs are only local, they're gone the moment a system is...

lockdown-labhardeninglinuxlogging
/Shimi Cohen

Ship logs to remote syslog / SIEM

Think an attacker won't erase their tracks? Think again. The first thing a sophisticated adversary does after gaining access is try to disappear. This means...

lockdown-labhardeninglinuxlogging
/Shimi Cohen

Enable and configure auditd

Attackers love operating in the dark. If you're not logging critical security events on your Linux servers, you're handing them a permanent stealth cloak. Remember...

lockdown-labhardeninglinuxlogging
/Shimi Cohen