Home » Questions » Computers [ Ask a new question ]

Changed sudoers file and can't open it anymore; can't open any file using root

Changed sudoers file and can't open it anymore; can't open any file using root

I changed settings in sudoers file using

Asked by: Guest | Views: 211
Total answers/comments: 1
Guest [Entry]

"James' idea to use a live cd (assuming the root account is not enabled) is a good one. I would add a few points.

First, you might get lucky and a
backup of the /etc/sudoers file was
automatically saved when you were
editing it. Check in /etc for a
file that looks like this sudoers~
(you can cd to that directory and
run ls -A without root
privileges, even if you can't read or
edit the files as a regular
user).Some editors will create such a
backup if at all possible, so you may
have one without having created it
explicitly.
Second, if you have no idea how to
edit the file, you might consider
posting it (or the area around line
7) here or elsewhere. Although the
file itself has to do with security,
there aren't passwords in it, so
there's no immediate harm in posting
it.
Last, note that an error message like
the one you saw doesn't necessarily
mean that the problem itself is
literally on line 7. The error might
be on line 4, but only got tripped
off, so to speak, on line 7."