Corrupted sudoers file preventing me from using sudo

0

I attempted to add another user to the sudoers list on my Raspberry Pi running Debian (Raspbian Jessie kernel ver 4.1). While doing so I entered the entry in wrong and I keep getting these errors every time I try to use sudo:

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

Now I cant use sudo to run visudo to change sudoers and for some reason I cant login under root because the default root login password of "raspberry" doesn't seem to work. Does anyone know how I can login into root or change sudoers so I don't have to re-flash the system? Any input would be much appreciated.

thanks

CompMan

Posted 2016-01-29T07:39:15.377

Reputation: 5

Answers

1

It looks like you will need to take the SD card out of that system and put it into another one so you can access the file system and make the required changes.

There are different ways you can do this here and here.

davidgo

Posted 2016-01-29T07:39:15.377

Reputation: 49 152

Based on the second link (the first link is broken) it doesn't look like this will allow me to change the password for root which I think I need to do to use visudo without sudo. I can log into the "pi" user with "raspberry" but it doesn't work with root – CompMan – 2016-01-29T08:03:12.673

nvm that worked for root. thanks for the help – CompMan – 2016-01-29T08:44:50.057