Disable SSH Access via Empty Passwords
An XCCDF Rule
Description
Disallow SSH login with empty passwords. The default SSH configuration disables logins with empty passwords. The appropriate configuration is used if no value is set forPermitEmptyPasswords
.
To explicitly disallow SSH login from accounts with empty passwords, add or correct the following line in
/etc/ssh/sshd_config
:
PermitEmptyPasswords noAny accounts with empty passwords should be disabled immediately, and PAM configuration should prevent users from being able to assign themselves empty passwords.
Rationale
Configuring this setting for the SSH daemon provides additional assurance that remote login via SSH will require a password, even in the event of misconfiguration elsewhere.
- ID
- xccdf_org.ssgproject.content_rule_sshd_disable_empty_passwords
- Severity
- High
- References
- Updated
Remediation Templates
A Shell Script
# Remediation is applicable only in certain platforms
if rpm --quiet -q kernel; then
if [ -e "/etc/ssh/sshd_config" ] ; then
LC_ALL=C sed -i "/^\s*PermitEmptyPasswords\s\+/Id" "/etc/ssh/sshd_config"
else
An Ansible Snippet
- name: Gather the package facts
package_facts:
manager: auto
tags:
- CJIS-5.5.6
- DISA-STIG-OL07-00-010300