4.2.11 Ensure SSH IgnoreRhosts is enabled

Information

The IgnoreRhosts parameter specifies thatrhosts andshosts files will not be used in RhostsRSAAuthentication or HostbasedAuthentication

Setting this parameter forces users to enter a password when authenticating with ssh.

Solution

Edit or create a file ending in *.conf in the /etc/ssh/sshd_config.d/ directory or the /etc/ssh/sshd_config file and set the IgnoreRhosts parameter as follows:

IgnoreRhosts yes

Run the following command to comment out any IgnoreRhosts parameter entries in files ending in *.conf in the /etc/ssh/sshd_config.d/ directory or the /etc/ssh/sshd_config file that include any setting other than yes

# grep -Pi '^h*IgnoreRhostsb' /etc/ssh/sshd_config /etc/ssh/sshd_config.d/*.conf | grep -Evi 'yes' | while read -r l_out; do sed -ri "/^s*IgnoreRhostss+/s/^/# /" "$(awk -F: '{print $1}' <<< $l_out)";done

See Also

https://workbench.cisecurity.org/benchmarks/12705

Item Details

Category: CONFIGURATION MANAGEMENT

References: 800-53|CM-6b.

Plugin: Unix

Control ID: 484a97541556bde37dbfa5a846e52eccff9f616acca4e4871f80c87c29da7d4d