How to validate that sudoers files and its included files have the correct syntax
in Linux
APPLIES TO:
Oracle Cloud Infrastructure
Linux x86-64
GOAL:
When editing /etc/sudoers file it is recommended to do it with visudo since it validates the syntax for errors that could render sudo unusable. In complex environments it isn’t uncommon to have sudoers rules that are made of several included files and or folders. The goal is to be able to validate all of them in once.
SOLUTION:
To validate a single sudoers file,run command below for the file to check:
$ visudo -f /etc/sudoers
To validate all of the referenced files in the current system we can use
Tagged:
0