Fix Borked Sudoers File on Ubuntu – How to Guide

sudoUbuntu

I was editing my /etc/sudoers file and saved it but it has a syntax error in there. Now I can't sudo vim /etc/sudoers because sudo thinks the sudoers file is not valid.

How can I fix this?

Best Answer

Boot the system into single mode and then edit it.