Audit who actually has sudo rights without grep-ing through a mess of files

User & Group Management

Audit who actually has sudo rights without grep-ing through a mess of files

🧩 The Challenge

Dealing with a massive sudoers file that includes a dozen different files in /etc/sudoers.d is a total nightmare when you need to know who can actually run commands as root. I’ve wasted way too much time manually checking nested includes and wondering if an old developer still has access to the web server.

💡 The Fix

Use the built-in sudo check tool to list all the effective privileges for a specific user. It clears up all the ambiguity caused by group memberships and directory includes.

sudo -U username -l

⚙️ Why It Works

This command parses every single sudoers config file on the system and prints out the effective access policy for that account. It saves you from having to mentally simulate the sudoers parser yourself.

🚀 Pro-Tip: Pipe it into grep to check for specific permissions if you’re cleaning up access for a departing employee.

Linux Tips & Tricks | © ngelinux.com | 9/23/2026

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Newest
Oldest Most Voted