Skip to content

6.2.7 Ensure no duplicate user names exist

Audit#

Run the following script and verify no results are returned:

1
2
3
4
5
#!/bin/bash

cut -d: -f1 /etc/passwd | sort | uniq -d | while read -r x; do
 echo "Duplicate login name $x in /etc/passwd"
done

Remediation#

Based on the results of the audit script, establish unique user names for the users. File ownerships will automatically reflect the change as long as the users have unique UIDs.