diff options
| -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.*$' |
