Skip to content

Restoring sudoers file on Mac OS

May 1, 2011

I recently change the permission on the /etc/sudoers file incorrectly and that caused it to be non-editable anymore.

The error shown is the following:

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

Since I do not know the root password, I had to use another method to fix the permission.

  • Boot into the single-user mode by pressing Cmd+S during boot-up.
  • Enable write mode on the filesystem by running the command: “mount -uw /”.
  • Go ahead now to correct the permission of the sudoers file: “chmod 440 /etc/sudoers”


No comments yet

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: