Skip to content

Verify Permissions on /etc/shells File

An XCCDF Rule

Description

To properly set the permissions of /etc/shells, run the command:
$ sudo chmod 0644 /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_permissions_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

chmod u-xs,g-xws,o-xwt /etc/shells