← Rules Catalog
highsystemverified

Ensure no duplicate user names exist

no-duplicate-usernames · RHEL ≥ 8 · 1 impl

Description

All user names in /etc/passwd must be unique. Duplicate user names can cause unpredictable behavior and security issues.

Rationale

Duplicate user names can lead to confusion about which account is being used and may result in unauthorized access if users share the same name with different UIDs.

Check → Remediate

Checkcommand
cut -d: -f1 /etc/passwd | sort | uniq -d
expected_exit:
0
Remediatemanual
note:
Review /etc/passwd and resolve any duplicate user names by either removing the duplicate accounts or renaming them to unique values.

Framework references

CIS

rhel9 7.2.6rhel8 7.2.6rhel10 7.2.6

NIST 800-53

IA-2AC-2

Live verification

rhel10:checkrhel8:checkrhel9:check
#accounts#passwd#security