Skip to main content

I was unsuccessful in replacing the /etc/sudoers file with a fresh new file and changing its permission to root:wheel and 0440.

Finally I had to go to Recovery Mode (restart → ⌘ CommandR)

  1. Mount Macintosh HD through Disk Utility
  2. Go to Terminal through Utilities
  3. cd /Macintosh HD/private/etc
  4. Edit sudoers file to correct the mistakes.
  5. Save and change permissions if needed. sudoers file needs root:wheel. If its not, sudo won't be run. chown root:wheel sudoers
  6. I had also changed the permission to 0440 since I initially removed sudoers and created a fresh copy when I was logged in.
  7. To change the permissions, run chmod 0440 sudoers
pranav
  • 253
  • 2
  • 5