3

I ran chmod 644 /usr/* on my installation of Mac OSX 10.6.

Now, everything is not working, from chmod to every other command. Obviously those commands are in /usr/bin, and I do not have execute permissions for chmod to give myself execute permissions.

3
  • 1
    What do you mean? chmod is in /bin/? Commented May 20, 2012 at 18:55
  • Is your machine still running- i.e., is Finder up? You can make mode changes in Finder too. If not, where does your boot process fail?
    – the paul
    Commented May 20, 2012 at 18:58
  • @PooriaAzimi mistake, i intended to say the sudo cmd is in /bin Commented May 21, 2012 at 20:23

3 Answers 3

6

The Typical Method

OSX has the built-in application Disk Utility to fix issues like this. Follow Apple's guide for troubleshooting permissions issues in Mac OS X, and learn about Disk Utility's Repair Disk Permissions feature.

For Mac OS X 10.2 or later, open Disk Utility (/Applications/Utilities/). Select your Mac OS X startup volume in the column on the left of the Disk Utility window, then click the First Aid tab. Click the Repair Disk Permissions button.


The Extreme Cases Methods

Method 1

  1. Download AppleJack
  2. Mount the AppleJack disk image, and run the AppleJack.pkg installer
  3. Now we will run AppleJack:
    1. Restart your computer
    2. When the "bong" sounds, hold down the and s keys until you get lots of text appearing on a black screen. You are now in single user mode.
    3. Type applejack auto restart at the prompt and hit return

Method 2 (with help from macstrategy.com)

  1. Find someone with an 10.6.* OSX install disc (or burn/write your own)
  2. Boot your Mac from the disc (do one of the following):
    1. Insert your install disc, restart your computer and hold down the c key (recommended).
    2. Insert your install disc, go to Apple menu > System Preferences > Startup Disk and select the install disc, then restart your computer.
    3. Insert your install disc, restart your computer and hold down the alt (option) key, select the install disc, click the up or right arrow.
  3. Select your required language.
  4. Don't install Mac OS X but instead go to the Utilities menu and select Disk Utility.
  5. Select the disk icon in the top left of the drive you want to repair permissions on e.g. Macintosh HD.
  6. Click on the First Aid tab at the top.
  7. Click on the Repair Disk Permissions button.
  8. When this has finished quit the Disk Utility application and restart your computer normally.
5
  • 1
    The disk utility is not running :( Commented May 21, 2012 at 20:24
  • I just updated my answer @karthik-ramasamy
    – evan.bovie
    Commented May 21, 2012 at 23:26
  • @emb1995 What is AppleJack? Commented May 22, 2012 at 1:10
  • @Luke From their SF site: AppleJack is a user friendly troubleshooting assistant for Mac OS X. With AppleJack you can troubleshoot a computer even if you cant load the GUI, or dont have a startup CD handy. AppleJack runs in Single User Mode and is menu-based for ease of use
    – evan.bovie
    Commented May 22, 2012 at 1:11
  • @emb1995 Looks interesting... Downloading Commented May 22, 2012 at 1:13
2

Well, most of the directories and files have 755 as the default so I would start there to allow you to execute common utilities. You can then later figure out if you want to tighten security.

sudo chmod -R 755 /usr

This page has a variety of ideas, depending on what you have access to. Example, if you have execute permissions on cp, mv and cat you could use the following sequence of commands to "copy" permissions from another file (in this example /bin/ls).

/bin/cp /bin/ls /tmp/chmod
/bin/cat /bin/chmod > /tmp/chmod
/bin/mv /tmp/chmod /bin/chmod

Notes: The first commands copies a file (including permissions). The second command copies the contents of chmod to the new file (does not overwrite permissions). The last command overwrites the original chmod file.

1
  • The main problem I have is I dont have execute permission for sudo,cp commands. Commented May 21, 2012 at 20:26
1

Another option is to run in Superuser mode, or run the CD

Superuser Mode

  1. Turn off the Mac
  2. Hold Command+s as you press Power
  3. When it starts, you'll be presented with a ROOT prompt. Mount the file system (as shows in the instructions when you start), then add your Execute permission

Run from the CD (recommended)

  1. Insert the Mac OSX DVD and shutdown the Mac
  2. Press and hold the Alt key as you turn on the Mac
  3. Select the Mac OSX Install DVD option
  4. Select your language and click Next
  5. Select Tools->Disk Utility
  6. Select your hard drive partition from the left side
  7. On the First Aid tab, click Repair Disk Permissions and wait

Once either of these are done, reboot your Mac

5
  • Actually, it is not recommended to repair permissions from the DVD. Apple recommends repairing while started up from a Mac OS X volume that contains Mac OS X. Running Disk Utility while started from the Mac OS X volume ensures that the changes made by software updates are preserved.
    – evan.bovie
    Commented May 20, 2012 at 23:05
  • @emb1995 It eliminates issues where the current installation won't run the repair properly. You can always run it again inside your installation Commented May 21, 2012 at 0:31
  • I tried your Superuser Mode solution and set the right permissions for the /usr and everything got fixed now except terminal, which was showing "could not determine audit condition" error and deleting /usr/bin/login file fixed that problem. Commented May 21, 2012 at 20:41
  • Thanks Luke and everybody for helping me out on this and saving me a work day :) Commented May 21, 2012 at 20:42
  • @KarthikRamasamy If it worked, remember to select it as the answer, unless another answer worked better for you Commented May 22, 2012 at 1:11

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .