Remove Rsh Trust Files
An XCCDF Rule
Description
The files /etc/hosts.equiv
and ~/.rhosts
(in
each user's home directory) list remote hosts and users that are trusted by the
local system when using the rshd daemon.
To remove these files, run the following command to delete them from any
location:
$ sudo rm /etc/hosts.equiv
$ rm ~/.rhosts
Rationale
This action is only meaningful if .rhosts
support is permitted
through PAM. Trust files are convenient, but when used in conjunction with
the R-services, they can allow unauthenticated access to a system.
- ID
- xccdf_org.ssgproject.content_rule_no_rsh_trust_files
- Severity
- High
- References
- Updated
Remediation - Shell Script
# Remediation is applicable only in certain platforms
if rpm --quiet -q rsh-server; then
find /root -xdev -type f -name ".rhosts" -exec rm -f {} \;
find /home -maxdepth 2 -xdev -type f -name ".rhosts" -exec rm -f {} \;
rm -f /etc/hosts.equiv
Remediation - Ansible
- name: Gather the package facts
package_facts:
manager: auto
tags:
- CCE-84145-2
- NIST-800-53-CM-6(a)