diff --git a/scripts/userlogs.sh b/scripts/userlogs.sh new file mode 100644 index 0000000..e1c8c7d --- /dev/null +++ b/scripts/userlogs.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +getent passwd | awk -F: '/^user/ {print $1}' | while read -r user; do + # Attempt to get the user's creation date from the shadow file + creation_date=$(sudo chage -l "$user" | grep 'Last password change' | cut -d: -f2) + echo "$user was created on $creation_date" +done