Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

I want to repair permissions of a user defined directory along with it's subdirectories.
How can I do this?

So far, I've looked for options in finder and tried to drag the folder into Disk Utility. But none of my ideas brought success.

share|improve this question
1  
Stupid question I know, but do you have root access? Also what are the messed up permission, are they just set to read only or something else? –  Chillie Jan 18 '12 at 16:01
    
@Chillie I'm admin. But this does not mean that I'm logged in as root, right? I've imported a large backup from a relative. This is just supposed to be general maintenance. –  gentmatt Jan 18 '12 at 16:09
    
@gentmatt you are correct, an admin account does not mean that the root user is enabled. –  pdd Jan 18 '12 at 16:55
1  
@gentmatt In order to properly answer this question, we need a little bit more insight as to what exactly the functional problem with the permissions is. –  Jason Salaz Jan 18 '12 at 17:19
    
Re: gentmatt and permissions from Windows XP PC - it's been a long time since I've even thought about this, but generally speaking Windows does not operate on the same permissions-based system as Mac OS X. As such, the permission differences are likely an intrinsic difference. What happens that these 'incorrect' permissions are a problem? –  soxman Jan 18 '12 at 18:48

4 Answers 4

up vote 5 down vote accepted

Repairing permissions only affects System files, and files installed from a package with the Installer, which give a BOM (Bill Of Materials, stored in the (~)/Receipts folder) that list the expected permissions. There is no meaning in repairing permissions for “a specific directory“, as an arbitrary directory has no expected permissions against which to compare, unless it is one listed in one of the said files.

(just for sourcing: Wikipedia agrees  ;)  )


If you want to change permissions of a lot of files at once, for example by having copied them from another drive with permissions, and you encounter problems with them, you could use a tool such as BatchMod :)

share|improve this answer
    
I didn't know that receipts carry permission sets. Nice to know. Having said that, I don't think I've ever seen permission messages for installed apps in Disk Utility after running 'repair disk permissions'. (Then again, why would they have ever changed? Methinks testing is necessary here.) –  Jason Salaz Jan 19 '12 at 17:33

I don't think Mac be default sets a user as root. So for you would need to enable root use, then its a simple matter of opening the terminal, logging in as root and changing the permissions.

something like this:

su # after typing this it should ask you for the root password
chmod -R 777 / #put the path to your directory after the slash.

chmod will change the permissions to the directory, the -R tells it to also change the permissions on all files and directories below it. the 777 means allow read, write and execute, however you can change that depending on what permission you want it to have. Here is a link to how to use chmod in case you need examples:

http://www.computerhope.com/unix/uchmod.htm

EDIT:

Credit to pdd for pointing out to me that you can always just use sudo instead of going through the trouble of setting up the root account. However you need to make sure your admin account has a non blank password.

http://support.apple.com/kb/HT4103

share|improve this answer
2  
I don't believe that you need to have the root user enabled to do this if you have an admin account and use 'sudo' instead of 'su', like this: sudo chmod -R 777 / #put the path to your directory after the slash. Enter your user's password when prompted. –  pdd Jan 18 '12 at 16:52
    
good call on that! –  Chillie Jan 18 '12 at 16:58
2  
You really, REALLY don't want to do what is suggested here. –  Jason Salaz Jan 18 '12 at 17:19
    
Who's to say he doesn't? I know Linux, I know Mac. By all accounts, my answer will work. Granted I will admit that if you don't know what you are doing, you shouldn't mess with root. Root can fix any permission problems. Root has access to everything and can do anything. –  Chillie Jan 18 '12 at 19:25
1  
I think @JasonSalaz jumped at the read of su; chmod -R 777 /. Even if you give the precision to “put the path after the slash”, I agree you seem (IMHO) too light-headed to give such a potentially dangerous command that way. Plus, you way your answer “will work” but, like most other answers, you have answered without knowing what the problem was. The OP said he wanted to “repair permissions”, without ever explaining how they were broken. Therefore, it was an OS X idiom that was not properly understood, as he made clearer in comments. So, too dangerous a command for an unknown problem. –  MattiSG Jan 19 '12 at 7:49

The act of "repairing permissions" is a very specific system-level only process. There is nothing in the UNIX-like world (such as BSD, which OS X is based on) that defines what a "correct" permission is. According to a Genius I spoke with at my local Apple Store, there is simply some file that lists important system files/folders, and clicking "Repair Disk Permissions" simply applies the appropriate permissions on the contents of that list.

Client file permissions have no "correct permission" because they can be whatever you want to achieve.

share|improve this answer
    
I'd love to provide more insight/detail, but the problem could be anything. More detail is needed. –  Jason Salaz Jan 18 '12 at 17:20
    
+1 for "According to a Genius..." :) I guess my question seems a little stupid due to my lack of knowledge in that matter. The data on the backup is mostly user generated (spreadsheets, photos, ...). Other data contains software licences and code projects. Since these are not files which are essential to the performance of the system, any permission for them is right? So you would say that there is no need to repair permissions here in the first place? –  gentmatt Jan 18 '12 at 17:44
    
The question I'm asking is: What is happening that leads you believe you need to repair permissions? –  Jason Salaz Jan 18 '12 at 17:59
    
This is a huge amount of data from an old PC running XP. I want to check if is all good. So, I did check it for viruses using Sophos. In my limited knowledge I thought that repairing permissions would be the next step for maintenaince. –  gentmatt Jan 18 '12 at 18:25
    
Permissions change when moved from PC to Mac To Linux, etc. You only really change permissions if you can't access something or if a program/ script needs access. –  Chillie Jan 18 '12 at 19:26

If I understand your question correctly, you're attempting to reset the permissions on a user's home directory. This is easily accomplished by resetting ACLs on the desired home directly by using the Reset Password utility in the Recovery Partition:

Restart your computer from the recovery partition (if running Lion) or the gray disk (if not running Lion). Open Disk Utility and run a permissions repair on your startup volume. After this is complete, close Disk Utility and open Terminal from the Utilities menu. Type in resetpassword and select your user account (NOT System Administrator/root) from the drop down menu. Click the Reset button at the bottom of the window in the Reset home folder permissions and ACLs section. Quit the Password Utility and go back to the main recovery screen. On your keyboard, hit Command+Q and restart your computer.

It's very important that you don't hold down the power button to exit the recovery session, or the ACL reset won't occur.

Let us know how it goes.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.