Sunday, March 28, 2010

sudo: must be setuid root

I did a silly thing this morning. I "chown"ed my /usr directory on my macbook pro to my username. This broke all commands like sudo, su etc and they became unusable. I couldn't chown it back to root anymore.

After a long hard search for 2 or even more hours I remembered seeing something about disk permissions in the mac osx "disk utility".

A quick "Command-Spacebar" to bring up spotlight search dialog, and then type in disk utility brings up the following window.


Selecting the drive to repair and clicking the "Repair Disk Permissions" Button at the bottom repairs all permissions on the file system.

Now I can "sudo" and "su" again.

Software and Dev Fixes

Hi Peoples.

I have finally had enough of crappy solutions to simple problems and situations. What pushed me over the edge was a permission issue on my mac, yes due to user error on my part. Searching for a solution for over an hour got me nowhere. Then I remembered something .... and fixed it in no time.

I decided to created this blog for the sole reason of keeping track of these issues. It will also be a place for people who develop in Java/Ruby/Objective C etc and also Mac/Windows users. I will place details of my solutions here. I hope it is useful to someone out there.

I will only blog when I come up with a solution to a problem I face. Mainly for me to remember and for others to reference. Granted some problems even though being the same might have different solutions on different platforms and might not be covered here. That is what the comments section is for. So feel free to use it.