From 44435b60f1196bb59d34bb4b52d57450ca6d8e1e Mon Sep 17 00:00:00 2001 From: mo khan Date: Tue, 1 Oct 2019 19:43:56 -0600 Subject: find duplicate uids --- README.md | 7 +++++++ bin/duplicate-ids | 3 +++ 2 files changed, 10 insertions(+) create mode 100755 bin/duplicate-ids diff --git a/README.md b/README.md index 4889909..8b9252d 100644 --- a/README.md +++ b/README.md @@ -1147,5 +1147,12 @@ Rootly Powers and Processes ``` c. Find any sets of entries that have duplicate UIDs. + + ```bash + #!/bin/bash + + cat /etc/passwd | grep -v -E '^#' | awk -F: '{ print $3 }' | sort -n | uniq -d + ``` + d. Find entries that have duplicate login names. e. Find entries that have no expiration date (needs /etc/shadow). diff --git a/bin/duplicate-ids b/bin/duplicate-ids new file mode 100755 index 0000000..2d04668 --- /dev/null +++ b/bin/duplicate-ids @@ -0,0 +1,3 @@ +#!/bin/bash + +cat /etc/passwd | grep -v -E '^#' | awk -F: '{ print $3 }' | sort -n | uniq -d -- cgit v1.2.3