summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md7
-rwxr-xr-xbin/uid-zero3
2 files changed, 10 insertions, 0 deletions
diff --git a/README.md b/README.md
index d8d1710..13c1fe5 100644
--- a/README.md
+++ b/README.md
@@ -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.*$'