1

When I edited my sudoers file & saved it on my Raspberry Pi, it's giving me:

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

I am trying to avoid sudo permissions for a bash which is trying to access a root file. I also tried pkexec, like a general Linux solution, but it's giving

-bash: pkexec: command not found

Now this error is showing everywhere I go using sudo.
Is there any solution for this?

7
  • 1
    Is it possible to provide the couple of lines before and after line 26 so we can see what the issue may be.
    – Hurgh
    Oct 9, 2013 at 21:24
  • @Hurgh, you need root permissions to read sudoers Oct 9, 2013 at 22:03
  • Boot off a live cd and mount the partition will allow you to view/edit/fix the sudoers file.
    – Hurgh
    Oct 10, 2013 at 0:00
  • if i can access any how to sudoers this discussion is not being taken place here. on every sudo permission giving same thing sudo: parse error in /etc/sudoers near line 26 sudo: no valid sudoers sources found, quitting sudo: unable to initialize policy plugin
    – Ayush
    Oct 10, 2013 at 6:17
  • Are you asking for a way to fix it without putting the SD card in a PC? A valid sudoers is required for you to get permission to edit sudoers (barring any privilege escalation exploits) Since you put syntax errors in this file, sudo will never allow you to edit it again. Oct 10, 2013 at 9:19

1 Answer 1

8

It's a good idea to use visudo to edit the sudoers file. It will prevent you from saving the file with errors.

The easiest way to fix it will be to mount the SD card on a linux PC (or use a live cd) and fix the file there

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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