mirror of
https://github.com/aquasecurity/linux-bench.git
synced 2025-02-23 22:55:34 +01:00
10 lines
No EOL
258 B
Bash
10 lines
No EOL
258 B
Bash
#!/bin/bash
|
|
|
|
cut -f1 -d":" /etc/passwd | sort -n | uniq -c | while read x ; do
|
|
[ -z "$x" ] && break
|
|
set - $x
|
|
if [ $1 -gt 1 ]; then
|
|
uids=$(awk -F: '($1 == n) { print $3 }' n=$2 /etc/passwd | xargs)
|
|
echo "Duplicate User Name ($2): $uids"
|
|
fi
|
|
done |