/etc/sudoers file problem


2 posts
by dc_dexter » Wed Jan 02, 2013 1:22 am
Hello to all,
I have improperly edited the /etc/sudoers file and now I can't sudo. I have tried going to su mode but don't know the password. I guess it was never set. I am getting this error anytime I try sudo.

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

I don't have keyboard on the pi and prefer remote administration through ssh. Is there a way to restore the sudoers file remotely? If not, how do I do it with a keyboard.

Thanks.
Posts: 2
Joined: Wed Jan 02, 2013 1:10 am
by dc_dexter » Wed Jan 02, 2013 2:06 am
Found the answer shortly after I posted. :oops: This worked.

"To do this via SSH, log in to the machine and run the command pkexec visudo. Assuming you (or some other user) are authorized to run programs as root with PolicyKit, you can enter your password, and then it will run visudo as root, and you can fix your /etc/sudoers."

from:
http://askubuntu.com/questions/73864/ho ... not-allowi
Posts: 2
Joined: Wed Jan 02, 2013 1:10 am