Welcome to the Tweaking4All community forums!
When participating, please keep the Forum Rules in mind!
Topics for particular software or systems: Start your topic link with the name of the application or system.
For example “MacOS X – Your question“, or “MS Word – Your Tip or Trick“.
Please note that switching to another language when reading a post will not bring you to the same post, in Dutch, as there is no translation for that post!
[Solved] MacOS X - How to fix a hosed /etc/sudoers file
(@hans)
Famed Member Admin
Joined: 12 years ago
Posts: 2859
Topic starter
November 11, 2015 3:00 AM
Just now I screwed up and hosed the file
/etc/sudoers
And that's a problem - this file maintains some of the rules which users are the sudo users, and after damaging the file one can no longer edit the file with:
sudo nano /etc/sudoers
And that sucks ... because now we cannot fix the file ...
I did find a surprising simple solution though.
Go to "/etc" with the Finder, and look at the file information ( command ⌘ + i ) of the file "sudoers". Set the access rights to "read" end "write" for all users, so "owner", "group" and "everyone". Your Mac will ask for your password a few times.
After that you can simply edit the file with:
nano /etc/sudoers
and correct the mistake you made (or revert back to it's original).
Do not forget to set the proper rights again when done, so only "owner" can "read" and "write".