At the time of a security audit, we can use a combination of Bash commands to enumerate users and gather details about their settings.
1. To list all the users
cat /etc/passwd
2. To check for users with login shells
awk -F':' '$7 ~ /\/bin\/bash/ {print $1}' /etc/passwd
3. To list user groups
cut -d: -f1 /etc/group
4. To show last login of each user
lastlog
5. To check the password policies
sudo cat /etc/shadow
All these files can be inspected while performing a security audit to identify any user accounts with weak or no passwords, interactive users, and misconfigurations.