DirectAdmin Knowledge Base and Support

DirectAdmin is a web panel for a simple administration of both virtual and dedicated servers. DirectAdmin is faster, safe and more powerful than any other CP. And we know how to customize and support it.

sudo: no valid sudoers sources found, quitting

| 13:50:05 08.01.2018

While installing new sudo instructions we faced an error: "sudo: no valid sudoers sources found, quitting". Here suggest we a fix which worked in our case.

Error message:

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

We had a need to allow a regular user to restart a service on CentOS 7, and here is what we added:

user ALL= NOPASSWD: systemctl restart custom.service

into sudoers file. The systemctl  binary was added without a full path to it. And it caused the error. So here comes a fix:


We specified a full path to the command and it worked:

user ALL= NOPASSWD: /bin/systemctl restart custom.service

No more errors. I hope it will help you if you face the same issue.

About Us
We are a team of professionals, and specialize in installation, configuring and managing of remote virtual and dedicated servers powered by Linux/Unix-like OS with DirectAdmin. We support various sets of software, including web-servers Apache, Nginx; internet domain name servers Bind, PowerDNS; mail-servers with POP3, IMAP and SMTP, FTP-servers, etc. After years of working through the most complex server challenges our team has gathered valuable experience and universal solutions suitable for everyday tasks. We are here to lend you a helping hand and take care of your servers in order to let you have enough time to do more of what you love.

All of the information and data on this site is for informational purposes only and is provided for the convenience of the user.
Powered by: Amiro.CMS - Free edition