If you messed up with editing sudoers
, this solution is for you. The solution is limited to restoring /etc/sudoers
file to the original state. It is easier to mess up your config such as saving wrong format, etc.
- Please reboot your macOS into recovery mode. While rebooting press and hold
Cmd+R
key. - After you completely reboot, you will see a dialog. You need to open
Terminal
by clickingUtilities > Terminal
on menu. - In order to mount
/etc
as writable state, you need to disable SIP first by executingcsrutil disable
. - Reboot into single user mode. While rebooting press and hold
Cmd+S
key.