diff options
| author | mo khan <mo.khan@gmail.com> | 2019-10-01 19:46:12 -0600 |
|---|---|---|
| committer | mo khan <mo.khan@gmail.com> | 2019-10-01 19:46:12 -0600 |
| commit | 6a9c857607513af51a367c7e87836b3c6931c6be (patch) | |
| tree | 217f87a37a1f9cd7a1bb798eed1585caa5a34823 | |
| parent | 44435b60f1196bb59d34bb4b52d57450ca6d8e1e (diff) | |
Complete a few more scripts
| -rw-r--r-- | README.md | 21 |
1 files changed, 13 insertions, 8 deletions
@@ -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). |
