Description
/etc/shadow is readable by the shadow group so that a few setgid programs (such as
unix_chkpwd) can check passwords. No user needs to be a member of this group.
Rationale
A user in the shadow group can copy every password hash and crack them offline.
Impact
None for a standard system.
Audit
getent group shadowshows no member after the last colon.awk -F: -v g="$(getent group shadow | cut -d: -f3)" '$4 == g' /etc/passwdprints nothing.
Automated: every check must pass. Scanners report each check by its id.
members
script: |
g=$(getent group shadow) || { echo "no shadow group"; exit 0; }
gid=$(printf '%s' "$g" | cut -d: -f3)
m=${g##*:}
p=$(awk -F: -v g="$gid" '$4 == g {print $1}' /etc/passwd | tr '\n' ' ')
echo "members: ${m:-none}; primary group of: ${p:-none}"
[ -z "$m$p" ]
Remediation
Remove each member with gpasswd -d <user> shadow, and give users whose primary group is
shadow another primary group with usermod -g <group> <user>.
| Restart | none |
| Disruption | low |
remove-members
cb_backup /etc/group
cb_backup /etc/gshadow
m=$(getent group shadow | cut -d: -f4)
for u in $(printf '%s' "$m" | tr ',' ' '); do gpasswd -d "$u" shadow >/dev/null; done
Handwritten code reads parameters from CB_<NAME> environment variables. Each release turns these fixes into remediate.sh and an Ansible role per profile: dry run by default, a fix runs only when its check fails.
References
- shadow(5), Ubuntu manual pages Canonical, vendor-doc, accessed 2026-10-19
Mappings
| Framework | ID | Relation |
|---|---|---|
| NIST SP 800-53 Rev. 55.1.1 | AC-6 | related |
How this control relates to the other framework's: equivalent, stricter, looser, partial or related.
Threats mitigated
| Taxonomy | ID |
|---|---|
| MITRE ATT&CK | T1003.008 |
People and lifecycle
| Authors |
|
| Verified | 2026-10-19 by Sn0wAlice on 20.04, Proxmox VM, Ubuntu 20.04 cloud image, kernel 5.4.0-216-generic. Passes on a fresh install; profiles core and server-hardened. |
| Verified | 2026-10-19 by Sn0wAlice on 22.04, Proxmox VM, Ubuntu 22.04 cloud image, kernel 5.15.0-198-generic. Passes on a fresh install; profiles core and server-hardened. |
| Verified | 2026-10-19 by Sn0wAlice on 24.04, Proxmox VM, Ubuntu 24.04 cloud image, kernel 6.8.0-147-generic. Passes on a fresh install; profiles core and server-hardened. |
| Verified | 2026-10-19 by Sn0wAlice on 26.04, Proxmox VM, Ubuntu 26.04 cloud image, kernel 7.0.0-38-generic. Passes on a fresh install; profiles core and server-hardened. |
| Introduced in | v0.1.0 |
| Created, updated | 2026-10-19, 2026-10-19 |
| Translations | fr |