I now know that I should never try to edit the etc/sudoers
file with a regular text editor. However, minutes before I learned this, I saved a new user name in the file with Sublime Text. Now when I run sudo cat sudoers
for example, I get the following error:
>>> /etc/sudoers: syntax error near line 1 <<<
sudo: parse error in /etc/sudoers near line 1
sudo: no valid sudoers sources found, quitting
How can I get out of this quandary?
su
. Otherwise, rebooting single-user or off a live CD should be the second easiest way to revert your file; I'll let someone post a proper answer ifsu
doesn't do the trick.su - root
and now I getpermission denied
. I also tried to reboot as single user and edit the file, but got the error that I was in a read-only filesystem.rw
from what I can remembermount -o remount,rw /