4.7.3.2 Ensure /etc/shosts.equiv and /etc/rhosts.equiv are removed

Information

The recommendation is to remove both the /etc/shosts.equiv and /etc/rhosts.equiv file. This is a consequence of the recommendation to not use HostbasedAuthentification

The recommendation is to not use HostbasedAuthentification unless there is a documented need already exists the logical consequence is to remove these files, if they exist, to lower the risk of accidental activation.

In any case - the file /etc/rhosts.equiv should be removed - period. ( Note: This is also recommended elsewhere.)

Solution

Print (for review) and then remove the content of the /etc/[rs]hosts.equiv files:

for file in /etc/[rs]hosts.equiv; do
print "+++ ${file} +++"
/usr/bin/cat -n ${file}
/usr/bin/rm -f ${file}
done

Impact:

The file /etc/shosts.equiv in combination with the OpenSSH

sshd_config:

HostbasedAuthentication can allow passwordless authentication between servers.

Without HostbasedAuthentication the file /etc/shosts.equiv has no purpose.

See Also

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

Item Details

Category: CONFIGURATION MANAGEMENT

References: 800-53|CM-7b.

Plugin: Unix

Control ID: fa71123125e8fa3770a5f1dd511e7fc9f0c4366b3085c98d46d73e42a676c822