How to correct invalid sudoers file


Inspired by my last post, but somehow messed up your sudoers file?

Don’t be afraid there’s a solution

So your

$ sudo visudo

is throwing something like this at you

>>> /etc/sudoers: syntax error near line 28 <<<
sudo: parse error in /etc/sudoers near line 28
sudo: no valid sudoers sources found, quitting

Fear not, just type su and then


And then you can delete the line that’s causing the error (in this case line 28) or try to correct it.

Comments are closed.