Page 1 of 1
Forum

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!



MacOS X - How to fi...
 
Share:
Notifications
Clear all

[Solved] MacOS X - How to fix a hosed /etc/sudoers file

1 Posts
1 Users
0 Reactions
1,694 Views
 Hans
(@hans)
Famed Member Admin
Joined: 12 years ago
Posts: 2859
Topic starter  

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".


   
ReplyQuote
Share: