Knowledge Base

Preserving for the future: Shell scripts, AoC, and more

Find used files in /etc/sudoers.d/

Sudo, when given the #includedir /etc/sudoers.d/ directive, will read files in that directory. According to its man page, it does not interpret files whose names include a dot or end with a tilde ~. You can list the files that are available for sudo to interpret with this statement:

find /etc/sudoers.d/ -type f ! -regex '\/etc\/sudoers\.d\/.*\..*'  ! -regex '\/etc\/sudoers\.d\/.*~'

Comments