Interview Prep/Linux/User Lifecycle, Auditing & Time Sync

How do you review who has access to a server?

IntermediateProductionUser Lifecycle, Auditing & Time Sync
Answer
getent passwd | awk -F: '$3>=1000 && $7 !~ /nologin|false/'   # interactive users
getent group sudo wheel                                         # admins
sudo grep -rv '^#' /etc/sudoers /etc/sudoers.d/ | grep -v '^\s*$'
sudo find /home /root -name authorized_keys -exec wc -l {} +
lastlog | grep -v 'Never logged in'
last -n 20

Automate this as a periodic access review report for compliance.

All Linux questions Roadmap: Linux

More on User Lifecycle, Auditing & Time Sync