Disable SSH Access via Empty Passwords
Forces PermitEmptyPasswords no so accounts with a blank password can never log in over SSH.
Checked against the resolved running state (e.g. sshd -T, sysctl, systemctl show), catches drop-ins and Includes a file read would miss. Caveat: runtime ≠ persistence; a value correct now may not survive a reboot.
Pavois asserts the effective configuration, the live, resolved state, not a file. File-based scanners (OVAL/SCAP, Lynis) miss Includes, drop-ins and runtime defaults; this check sees what is actually applied.
A mapping is a cross-reference to where each standard places this requirement, anchored and cross-validated, not a claim of equivalence. A passing check is evidence toward these references, how to read it.
Why this rule matters
If an account ends up with an empty password (through misconfiguration, a provisioning bug, or a careless passwd -d), PermitEmptyPasswords yes lets a remote attacker log in with no credential at all, instant unauthenticated access, possibly to a privileged account. Setting it to no is a defence-in-depth backstop: even if an empty password slips into /etc/shadow, SSH still refuses the login.
What Pavois checks
Pavois reads the effective value from sshd -T, which reflects the main config plus every Include, drop-in in /etc/ssh/sshd_config.d/, and Match block. A file-based scan of /etc/ssh/sshd_config would miss a PermitEmptyPasswords yes re-enabled in a drop-in or inside a Match stanza.
describe command('sshd -T') do
its('stdout') { should match(/^permitemptypasswords\s+no$/i) }
endHow to verify it is applied
Run sshd -T | grep -i '^permitemptypasswords'. Expected output is permitemptypasswords no.
Inspect & investigate
Authentication attempts (accepted/rejected) are logged in /var/log/auth.log (Debian/Ubuntu) or journalctl -u sshd (RHEL family). A refused empty-password login shows as a failed authentication line.
Remediation
Pavois's harden plan writes the sshd_setting directive PermitEmptyPasswords no in a managed drop-in, runs sshd -t to validate, then reloads the ssh service. Apply it with pavois harden apply.
Pavois applies this with its own harden engine, the plan below, not a shell script:
| directive | permitemptypasswords |
|---|---|
| notify | action: reload, service: ssh.service |
| resource | sshd_setting |
| value | no |
| verify | sshd -t -f %{path} |
pavois harden plan localwhere the target is local, a user@host SSH alias, or a container , Docs
Impact & precautions
No impact on any properly-provisioned account, since legitimate users have real passwords or key-based auth. The only logins this blocks are those that should never have been possible. No lockout risk for normal users; the reload preserves active sessions.
Standards mapping
| Standard | Reference | Type | Version | Confidence |
|---|---|---|---|---|
| CIS | 2.2.6, 5.1.19, 5.1.21 | direct | per OS, see the benchmark table | high |
| NIST | 3.1.1, AC-17(a), CM-6(a), CM-7(a), CM-7(b) | supporting | 800-53 Rev 5 · 800-171 Rev 2 (pinned) | medium |
| PCI DSS | 2.2.6 | supporting | 4.0.1 | medium |
| DISA STIG | UBTU-22-255025, UBTU-24-300031 | direct | per OS STIG release | high |
Each reference is a cross-reference anchored in the upstream benchmark and cross-validated against the SCAP Security Guide and ansible-lockdown, not a claim of equivalence. Direct = a prescriptive, line-level requirement; supporting = an abstract control family (NIST) the check provides evidence toward. How to read a mapping.