Bootstrap FreeKB - Linux Commands - Resolve "sudo: unable to initialize policy plugin"
Linux Commands - Resolve "sudo: unable to initialize policy plugin"

Updated:   |  Linux Commands articles

Let's say something like this is being returned when attempting to issue a command using sudo.

sudo: parse error in /etc/sudoers near line 23
sudo: no valid sudoers sources found, quitting
sudo: unable to initialize policy plugin

 

Naughty Naughty! This means someone editted a sudo file without using visudo. The visudo command would not let you save a change to a sudo file that would cause a sudo file to be misconfigured. Sudo files should always be editted using visudo.

OK - now that the lecture is done, how to fix this. Fortunately, the pkexec almost always can be used to fix a broken sudo file. For example, if the main sudo.conf file is misconfigured, you can use the following command to find and fix the misconfiguration.

pkexec visudo

 

Or, if a child sudo file is misconfigured, then the -f flag can be used to fix the misconfigured child sudo file.

pkexec visudo -f /etc/sudoers.d/my.file

 




Did you find this article helpful?

If so, consider buying me a coffee over at Buy Me A Coffee



Comments


Add a Comment


Please enter f2a225 in the box below so that we can be sure you are a human.