Go Back   The macosxhints Forums > OS X Help Requests > UNIX - General



Reply
 
Thread Tools Rate Thread Display Modes
Old 11-23-2012, 03:32 PM   #1
Tux
Prospect
 
Join Date: Jun 2005
Posts: 23
how to repair /etc/sudoers ?

Hi,
I work on my iMac normally with a non-admin user account. I wanted to give it some extra capabilities by editing /etc/sudoers (-r--r----- root wheel) after becoming admin (`su - admin`).
I have the habit to keep a memory of important config files with old-fashioned rcs, so I did a `sudo ci -l`. This changed the rights to -rw-r----- . Now whenever I want to do anything with sudo, I get:

sudo: /etc/sudoers is mode 0640, should be 0440
Segmentation fault

Yeah, nice built-in Nazi security feature. Also note the graceless finishing.
Admin cannot change the file permissions, and admin cannot sudo to root who could.
What can I do to repair this??

Tom
Tux is offline   Reply With Quote
Old 11-23-2012, 04:13 PM   #2
jsalmi
Triple-A Player
 
Join Date: May 2008
Location: Down by the river
Posts: 190
sudo chmod 440 /etc/sudoers
jsalmi is offline   Reply With Quote
Old 11-23-2012, 06:43 PM   #3
acme.mail.order
League Commissioner
 
Join Date: Sep 2003
Location: Tokyo
Posts: 6,045
Quote:
Originally Posted by jsalmi
sudo chmod 440 /etc/sudoers

Can't fix the sudoers file using sudo.

Tux: you will have to reboot into single-user mode and repair the file's permissions from there. And stop fiddling with it in the future.

If you really need to edit it, use visudo - it does a syntax check before saving it so you don't lock yourself out making a typo.
acme.mail.order is offline   Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



All times are GMT -5. The time now is 12:08 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2013, vBulletin Solutions, Inc.
Site design © IDG Consumer & SMB; individuals retain copyright of their postings
but consent to the possible use of their material in other areas of IDG Consumer & SMB.