diff options
| author | mo khan <mo.khan@gmail.com> | 2019-09-29 20:27:46 -0600 |
|---|---|---|
| committer | mo khan <mo.khan@gmail.com> | 2019-09-29 20:27:46 -0600 |
| commit | acadf7749ae6469f9d0fb946b4cb5cc5dcf17940 (patch) | |
| tree | addca9075704dc77d370581b6136a68686f8c2b8 | |
| parent | a4809f8c5ca83960bb946012a74d1b0c6f65eb70 (diff) | |
Find entries with id 0
| -rw-r--r-- | README.md | 7 | ||||
| -rwxr-xr-x | bin/uid-zero | 3 |
2 files changed, 10 insertions, 0 deletions
@@ -1127,6 +1127,13 @@ Rootly Powers and Processes 1. Write a shell script to help monitor the health of your /etc/passwd file. a. Find entries that have UID 0. + + ```bash + #!/bin/sh + + cat /etc/passwd | grep -P '^\w+:[x]:\d+:0.*$' + ``` + b. Find entries that have that have no password (needs /etc/shadow). c. Find any sets of entries that have duplicate UIDs. d. Find entries that have duplicate login names. diff --git a/bin/uid-zero b/bin/uid-zero new file mode 100755 index 0000000..129d587 --- /dev/null +++ b/bin/uid-zero @@ -0,0 +1,3 @@ +#!/bin/sh + +cat /etc/passwd | grep -P '^\w+:[x]:\d+:0.*$' |
