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 - Ansible

- name: Test for existence /etc/shells
  stat:
    path: /etc/shells
  register: file_exists
  tags:
  - CCE-86634-3

Remediation - Shell Script






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