Skip to content

Verify Who Owns /etc/shells File

An XCCDF Rule

Description

To properly set the owner of /etc/shells, run the command:
$ sudo chown root /etc/shells 

Rationale

The /etc/shells file contains the list of full pathnames to shells on the system. Since this file is used by many system programs this file should be protected.

ID
xccdf_org.ssgproject.content_rule_file_owner_etc_shells
Severity
Medium
References
Updated

Remediation Templates

An Ansible Snippet

- name: Test for existence /etc/shells
  stat:
    path: /etc/shells
  register: file_exists
  tags:
  - NIST-800-53-AC-3

A Shell Script

chown 0 /etc/shells