Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Error executing sudo command

When I try to execute a sudo command I get the following message:

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

What does it mean?

Thanks for all the help.

MacBookpro 17", Mac OS X (10.6.3)

Posted on Jun 4, 2010 8:15 PM

Reply
2 replies

Jun 4, 2010 8:36 PM in response to alkhater

When I try to execute a sudo command I get the following message:

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

What does it mean?

It means someone has incorrectly modified the /etc/sudoers file, and as a side effect its permissions were changed to an insecure form, so sudo refuses to use the file. It is also possible that the /etc/sudoers file syntax is also invalid, which might also cause the segmentation fault.

'visudo' should be used to edit the /etc/sudoers file, which would have properly preserved the permissions, as well as verified that the updated /etc/sudoers file contained valid syntax so that sudo would continue to work. See 'man visudo'.

You now have a problem, in that you can no longer use sudo to fix the permissions.

You should first try booting your installation DVD. Via the Menu, you can run Disk Utility and run Repair Permissions. Hopefully this will repair the /etc/sudoers file. You could try running Applications -> Utilities -> Disk Utility, however, if it wants to use sudo to elevate its privileges, that would fail, as a broken /etc/sudoers file is still a broken /etc/sudoers file.

If you have by any chance enabled the 'root' account, you could try logging in as root and fixing the /etc/sudoers file's permissions.

You should also run visudo, so that the file's syntax is valid.

I think you can use the Installation DVD to enable the root account. that might be another way to login as root.

If repair permissions does not work, then maybe you can put your Mac into firewire target mode, mount your Mac's disk on another Mac via firewire, and repair the /Volume/Macintosh HD/etc/sudoers permissions from the working Mac.

If that failes, the next step is booting your Mac in Single User mode. Search for "Single User Mode" in the forums, and you should find instructions on both booting, as well as how to make the root file system writable so you can change the permissions from single user mode.

And if that does not work, I think you are left with reinstalling the OS.

Message was edited by: BobHarris

Error executing sudo command

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.