← All rules
SOCLE-CLD-FSP-088// File ownershipmediumfilesystem state

Verify Who Owns /etc/shells File

Ensures the valid-login-shells list /etc/shells is owned by root (UID 0).

Checked against a path’s metadata, mode, owner, group, SUID/SGID.

A pass proves✓ running now✓ on disk✓ survives rebootthe qualified verdict →
Debian 12CIS 1.1.0Debian 13CIS 1.0.0FedoraRHEL 10 / Rocky 10 / AlmaLinux 10RHEL 8 / Rocky 8 / AlmaLinux 8CIS 4.0.0RHEL 9 / Rocky 9 / AlmaLinux 9CIS 2.0.0Ubuntu 22.04CIS 3.0.0Ubuntu 24.04CIS 1.0.0Ubuntu 26.04
One check, maps to 3 standards

A mapping is a cross-reference to where each standard places this requirement, anchored and cross-validated, not a claim of equivalence. A passing check is evidence toward these references, how to read it.

Why this rule matters

The /etc/shells file lists the full pathnames of valid login shells. It is consulted by programs such as chsh, FTP daemons and getusershell()-based services to decide whether an account is allowed an interactive shell. If a non-root account owns it, that user could add an arbitrary binary as a 'shell' to gain or broaden interactive access. Setting root (UID 0) as the owner protects this access-control list.

What Pavois checks

Pavois inspects the live filesystem with the InSpec file('/etc/shells') resource and asserts uid == 0, guarded by only_if so it is skipped when the file is absent. Reading the real inode owner reflects the effective on-disk state, catching a chown that would let a user register an unauthorized shell.

only_if { file('/etc/shells').exist? }
describe file('/etc/shells') do
  its('uid') { should eq 0 }
end

How to verify it is applied

Run stat -c '%U %u %n' /etc/shells. Expected output: root 0 /etc/shells. The numeric 0 confirms root ownership.

Inspect & investigate

Watch the file with auditctl -w /etc/shells -p wa -k shells and inspect /var/log/audit/audit.log (grep 'key="shells"'). Shell-change attempts via chsh are logged by PAM in /var/log/auth.log / journalctl.

Remediation

No automated remediation is shipped for this rule. Apply it manually with chown root /etc/shells (run as root or via sudo); the file should remain group root and mode 0644.

Pavois applies this with its own harden engine, the plan below, not a shell script:

ownerroot
path/etc/shells
resourcefile
pavois harden plan local

where the target is local, a user@host SSH alias, or a container , Docs

Impact & precautions

A non-root owner could register an arbitrary binary as a login shell, broadening interactive access. Risk of applying: none, chown root does not change which shells are listed and does not affect existing logins. Keep the file world-readable (0644) so getusershell() consumers still work.

Standards mapping

StandardReferenceTypeVersionConfidence
ANSSI BP-028R50direct2.0high
CIS7.1.9directper OS, see the benchmark tablehigh
NISTAC-3, MP-2supporting800-53 Rev 5 · 800-171 Rev 2 (pinned)medium

Each reference is a cross-reference anchored in the upstream benchmark and cross-validated against the SCAP Security Guide and ansible-lockdown, not a claim of equivalence. Direct = a prescriptive, line-level requirement; supporting = an abstract control family (NIST) the check provides evidence toward. How to read a mapping.

Sources & references