summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormo khan <mo.khan@gmail.com>2019-10-01 19:46:12 -0600
committermo khan <mo.khan@gmail.com>2019-10-01 19:46:12 -0600
commit6a9c857607513af51a367c7e87836b3c6931c6be (patch)
tree217f87a37a1f9cd7a1bb798eed1585caa5a34823
parent44435b60f1196bb59d34bb4b52d57450ca6d8e1e (diff)
Complete a few more scripts
-rw-r--r--README.md21
1 files changed, 13 insertions, 8 deletions
diff --git a/README.md b/README.md
index 8b9252d..84d10d8 100644
--- a/README.md
+++ b/README.md
@@ -1140,19 +1140,24 @@ Rootly Powers and Processes
b. Find entries that have that have no password (needs /etc/shadow).
- ```bash
- #!/bin/bash
+ ```bash
+ #!/bin/bash
- grep -E '^\w+::.*' /etc/passwd
- ```
+ grep -E '^\w+::.*' /etc/passwd
+ ```
c. Find any sets of entries that have duplicate UIDs.
- ```bash
- #!/bin/bash
+ ```bash
+ #!/bin/bash
- cat /etc/passwd | grep -v -E '^#' | awk -F: '{ print $3 }' | sort -n | uniq -d
- ```
+ cat /etc/passwd | grep -v -E '^#' | awk -F: '{ print $3 }' | sort -n | uniq -d
+ ```
d. Find entries that have duplicate login names.
+
+ ```bash
+ cat /etc/passwd | grep -v -E '^#' | awk -F: '{ print $1 }' | sort | uniq -d
+ ```
+
e. Find entries that have no expiration date (needs /etc/shadow).