summaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authormo khan <mo.khan@gmail.com>2019-10-11 19:29:11 -0600
committermo khan <mo.khan@gmail.com>2019-10-11 19:29:11 -0600
commit46a31fa7d3a86ed1f7c5ac33e795c4bbf7b9ced3 (patch)
tree3469cc6f546598d5c75208886574b7981bd2e709 /README.md
parent6a9c857607513af51a367c7e87836b3c6931c6be (diff)
Print accounts that do not have an expiration
Diffstat (limited to 'README.md')
-rw-r--r--README.md15
1 files changed, 15 insertions, 0 deletions
diff --git a/README.md b/README.md
index 84d10d8..c44bff9 100644
--- a/README.md
+++ b/README.md
@@ -1161,3 +1161,18 @@ Rootly Powers and Processes
```
e. Find entries that have no expiration date (needs /etc/shadow).
+
+ ```bash
+ #!/bin/bash
+
+ cd "..$(dirname $PWD)"
+
+ for i in `cat /etc/shadow`; do
+ login=$(echo $i | cut -d: -f1)
+ expiration=$(echo $i | cut -d: -f8)
+
+ if [ -z "$expiration" ]; then
+ echo $login: does not have an expiration date
+ fi
+ done
+ ```