All .rhosts, .shosts, .netrc, or hosts.equiv files must be accessible by only root or the owner.

From Oracle Linux 5 Security Technical Implementation Guide

Part of GEN002060

Associated with: CCI-000225

SV-63635r1_rule All .rhosts, .shosts, .netrc, or hosts.equiv files must be accessible by only root or the owner.

Vulnerability discussion

If these files are accessible by users other than root or the owner, they could be used by a malicious user to set up a system compromise.

Check content

Procedure: # ls -l /etc/hosts.equiv # ls -l /etc/ssh/shosts.equiv # find / -name .rhosts # ls -al /.rhosts # find / -name .shosts # ls -al /.shosts # find / -name .netrc # ls -al /.netrc If the .rhosts, .shosts, hosts.equiv, or shosts.equiv files have permissions greater than 600, then this is a finding. If the /etc/hosts.equiv, or /etc/ssh/shosts.equiv files are not owned by root, this is a finding. Any .rhosts, .shosts and .netrc files outside of home directories have no meaning and are not subject to this rule If the ~/.rhosts or ~/.shosts are not owned by the owner of the home directory where they are immediately located or by root, this is a finding.

Fix text

Ensure the permission for these files is set to 600 or more restrictive and their owner is root or the same as the owner of the home directory in which they reside. Procedure: # chmod 600 /etc/hosts.equiv # chmod 600 /etc/ssh/shosts.equiv # chown root /etc/hosts.equiv # chown root /etc/ssh/shosts.equiv # find / -name .rhosts # chmod 600 //.rhosts # chown /.rhosts # find / -name .shosts # chmod 600 /.shosts # chown /.shosts # find / -name .netrc # chmod 600 /.netrc # chown /.netrc

Pro Tips

Lavender hyperlinks in small type off to the right (of CSS class id, if you view the page source) point to globally unique URIs for each document and item. Copy the link location and paste anywhere you need to talk unambiguously about these things.

You can obtain data about documents and items in other formats. Simply provide an HTTP header Accept: text/turtle or Accept: application/rdf+xml.

Powered by sagemincer