Possible Duplicate:
Ubuntu : borked my sudoers file, how can I fix it?
Problem description:
I have broken my /etc/sudoers file by making a typo in it. Now I can no longer use any sudo commands as the below error is thrown. Therefore I can't fix my sudoers file and am effectively stuck.
$ sudo nano /etc/sudoers
>>> /etc/sudoers: syntax error near line 39 <<<
sudo: parse error in /etc/sudoers near line 39
sudo: no valid sudoers sources found, quitting
I found few solutions saying I should boot into recovery mode (like the one below) which I would obviously like to avoid.
Ubuntu : borked my sudoers file, how can I fix it?
Questions:
-Are there any other ways to fix it without restarting ubuntu?
-If it is so easy to lock yourself out of sudo when modifying the sudoers file (everybody can do a typo), why isn't the sudoers config read from memory instead of the file directly? There would be a command (e.g. sudo-load) that would make sure the syntax is OK before loading the config into memory thus avoid this sort of problems.
Solutions:
There seems to be 2 ways of recovering it:
-if you have the root password you can simply issue a 'su' and then edit the file
-if you don't have the root password you need to restart into single user mode