I did the following commands:

sudoers users list:

for USER in `cut -d: -f1 /etc/passwd`; do   sudo -U $USER -l; done | egrep -A 1 'may run' 

users on root group:

getent passwd | grep -ve 'nologin' -ve 'false' -ve 'sync' -ve 'shutdown' -ve 'halt' | awk -F: '{print $1}' | while read name; do groups $name; done | grep root 

Is there something that I forgot?

Thanks in advance

  • For standard system you should also check files in /etc/pam.d/ and probably cron jobs too. But know that this is in no way a full audit. There is a lot of other ways someone could get administrative access - other SUID binaries besides sudo for example. – Marek Rost May 8 '18 at 9:40

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.