visudo fails with an error "sudo: no valid sudoers sources found, quitting"
Issue
- While executing sudo, below error is observed :
[testuser@localhost ~]$ sudo vi /etc/sudoers
>>> /etc/sudoers.d/testuser: syntax error near line 1 <<<
sudo: parse error in /etc/sudoers.d/testuser near line 1
sudo: no valid sudoers sources found, quitting
sudo: unable to initialize policy plugin
Environment
- Red Hat Enterprise Linux
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.