sudo chmod -R 777 /

35,807

Solution 1

Take a look at Apple's Disk Utility's Repair Disk Permissions feature:

http://support.apple.com/kb/HT1452?viewlocale=en_US

Solution 2

From http://support.apple.com/kb/HT2963:

Using the Repair Privileges Utility

Most users of Mac OS X have not intentionally modified privileges and simply need a utility to reset system privileges to their correct default values. If you have Mac OS X 10.2 and later, this utility is included in the operating system. If you have Mac OS X 10.1 you can download it. For versions 10.0 to 10.1.4, you must update to version 10.1.5 first.

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. You may see an erroneous message.

Solution 3

You're in luck:

It won't fix everything, but it will fix everything that's listed in the bill of materials file for an installed package.

Share:
35,807

Related videos on Youtube

Casey Flynn
Author by

Casey Flynn

American software engineer living in Taipei, Taiwan. 只是一個住在台北的工程師. Mostly speaks English and 中文. 11100100 10111101 10100000 11100101 10100101 10111101 https://cflynn.us

Updated on September 18, 2022

Comments

  • Casey Flynn
    Casey Flynn over 1 year
     sudo chmod -R 777 /
    

    I did this. It was a mistake. Is there any way to undo it?

    Basically it's messed up more things than I can list. I don't have time-machine enabled on my mac.

    • Casey Flynn
      Casey Flynn almost 13 years
      Serious question man, is there any way to undo it.
    • joaquin
      joaquin almost 13 years
      777 permissions are almost never the answer to any permissions problem. It might get you past a hiccup, but it is seldom a good idea, even when restricted to a directory deep in your disk system. It is a catastrophe when applied to all files and directories under root, not least because it attempts to remove SUID bits from programs such as 'sudo' that need them. Don't do it again! (Many Unix users can regale you with a story of an analogous mistake; I won't bother you with mine, but the backups of the system saved the day, and it wasn't me who typed the command that achieved the rm -fr /.)
    • Scott
      Scott almost 13 years
      Let this be a lesson to everyone about why sudo goes on about "think before you type" the first time you use it. ;-)
    • ott--
      ott-- over 12 years
      Do a ls -lR / >list on a healthy system (or ask someone else for a list). You could automate this process to re-set the permissions (if this Dirk Utility Repair won't work).
    • hwshadow
      hwshadow almost 11 years
      Tab Auto-complete saves lives ;3
  • kylex
    kylex almost 13 years
    This won't undo your changes, but it should fix most of the issues due to improper permission settings.
  • Casey Flynn
    Casey Flynn almost 13 years
    Will this repair my 'sudo' program?
  • kylex
    kylex almost 13 years
    @Casey - What is the issue with sudo? sudo just allows you to run a command as root. ie. bypasses many security restrictions.
  • sehe
    sehe almost 13 years
    @kylex: it probably refuses to work since /etc/suoers is worldwritable :) Good thinking
  • larsks
    larsks almost 13 years
    Sudo probably refuses to work because it needs the suit bit set and by recursively changing everything to mode 777 the OP has stripped the suid bit on sudo (and all other privileged programs). Without the suid bit set, sudo cannot gain elevated privileges and hence cannot grant you access other than that which you already have. Unless Disk Utility has an alternative mechanism for gaining elevated privileges, Casey will probably have to arrange to log in as root.
  • Keith Thompson
    Keith Thompson over 12 years
    chmod -R 644 will make all directories non-searchable. It would be difficult to recover from that.