Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

My /etc/sudoers file is somehow corrupted and all the users who have sudo privileges are unable to execute ANY command with sudo prefix to the command !

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

I have tried almost all the solutions suggested in previous similar questions like

  1. rebooted the system many times
  2. Tried to modify the file /etc/sudoers.d/README but was unable to do so.
  3. In recovery mode, mounted the file system with rw and tried to modify the mentioned file but was unsuccessful
  4. pkexec bash..... still no use

The file line in /etc/sudoers.d/README is infact an empty line.

Can you please guide me !

Thanks.

share|improve this question

1 Answer 1

On my Ubuntu-based system (Mint) /etc/sudoers.d/README is all comments, like # ... there is no line that isn't a comment. And other files in /etc/sudoers.d/ contain blank lines with no errors from sudo... is it possible your blank line contains some weird non-printable character? A hex editor should show anything weird in it.

And since the README file is all comments it shouldn't be necessary for sudo to work anyway, except for this comment in it:

# Note that there must be at least one file in the sudoers.d directory (this
# one will do), and all files in this directory should be mode 0440.

So as long as there's another file in that directory, you could try moving your corrupt README file out of the dir and see if that helps.

And you should have been able to modify the file in a recovery mode in your attempt 3, I'm assuming you would have been given permission to modify any file, like booting from a live cd/dvd/usb, if you couldn't edit the file maybe the file &/or filesystem itself is corrupt, tried a fsck ?

And here's another well-liked (upvoted) guide on how to fix a corrupt sudoers file, if it doesn't work then I'd look into the fsck/corrupt filesystem possibility.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.