4.2.11 Ensure SSH IgnoreRhosts is enabled

Information

The IgnoreRhosts parameter specifies that .rhosts and .shosts files will not be used in RhostsRSAAuthentication or HostbasedAuthentication.

Rationale:

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

Default Value:

IgnoreRhosts yes

See Also

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

Item Details

Category: ACCESS CONTROL, IDENTIFICATION AND AUTHENTICATION

References: 800-53|AC-14a., 800-53|IA-5

Plugin: Unix

Control ID: c683dead87350b34c75e6edc3155a48a2b7a2bf7d7423f21900de327f61c4bea