9

My issue is that I've seriously busted all of the owners and permissions on my user folder and subfolders and it's causing lots of issues using lots of applications.

The initial cause was that I had renamed a user by following the Apple support instructions at http://support.apple.com/kb/HT1428

After the new user was set up, Mozy backup wouldn't backup any more and lots of my applications couldn't update themselves automatically. The application usually started working again if I deleted the offending program and reinstalled it. I thought it was because the permissions were wrong and I found some places where GetInfo indicated that permissions were referencing the old user. Sometimes the dialog just said "Fetching" for the username and never updated to anything else.

I ran Onyx "fix permissions" and Disk Utility "Repair Permissions" with no results. With "Repair Permissions", it keeps throwing some info warnings about unexpected ACLs, but the info I could find online didn't think those would be causing issues like this.

I tried to recursively run some command line scripts on the user folders (both logged in as root and using sudo). chmod got lots of errors about the owner of the files being wrong. chown after that gave me other errors (I can't remember exactly what they were). In a fit of panic, I right-clicked the entire user folder and chose to apply it's permissions to all children.

From what I can tell, when I did that, I set everything to Read&Write for that user and Read-Only for "everyone" and "staff". Now, I'm worse off than before. Firefox crashed and it can't even update it's own settings so it brings up the "Do you want to restore these tabs" every single time it launches, even after repeatedly saying "Start New Session".

Basically, everything in my user folder is broken with regards to owner and permissions and I need to know what they are supposed to be. Who is the owner of the files in each directory supposed to be (Downloads, Applications, etc.) and what should the permissions be? Given those permissions and owners, what is the best way to go about setting those all right?

I saw a question similar to this at Resetting user permissions to their default mode but it only addresses permissions, not owners, which has been an issue already.

I'm not sure if reinstalling the OS over the copy I have right now would fix anything and I'm close to calling Apple Support if I can't figure anything out in the next few days. Thanks for any help.

4
  • Have you at least figured out how this happened? What specifically is wrong? ACL, metadata or the traditional UNIX permissions. It's hard to cover everything in one answer - especially resetting the immutable bits if needed.
    – bmike
    Mar 8, 2012 at 17:39
  • And to make the troubleshooting easier, I would install the OS onto an external drive, boot from that and mount your "problem" drive to ignore permissions and see if rsync or something will let you get the files into a cleaner state. Then you could delete the user and copy things back in - respecting the new user's ACL and permissions on the folders in ~ - careful to move the contents of ~/Library/ and not ~/Library itself.
    – bmike
    Mar 8, 2012 at 17:41
  • I'm not sure other than what I typed above. I appreciate the suggestions but I'm not much of a power user. If it's more complicated than a few command line or utilities, I'm just going to give up and restore from a Time Machine backup.
    – cisellis
    Mar 9, 2012 at 15:20
  • Good plan. You can get help from a technician if needed once your backup is restored - usually you can then have a short list of things that are out-dated or missing. I'm glad you have a backup :-)
    – bmike
    Mar 9, 2012 at 16:25

7 Answers 7

10

The first step I would recommend is to try resetting your home folder permissions with the Reset Password utility in Lion Recovery. (Despite the name of the utility, you won't actually be resetting any passwords.)

Resetting the home folder permissions with the Reset Password utility will reset both the owner and the permissions.

  1. Restart your Mac holding +R to boot into Lion Recovery, which will bring you to the Repair Utilities screen.

  2. Open Terminal from the Utilities menu.

  3. In Terminal, enter resetpassword to open the Reset Password utility.

  4. Choose your hard drive icon at the top, then choose your user from the drop-down menu below. Do not reset the password here.

  5. At the bottom of the window, under "Reset Home Directory Permissions and ACLs", click the "Reset" button. This may take awhile if you have a lot of files in your home folder.

This should solve your permissions problems for most apps. However, it's possible you may have a few apps which had saved files with special permissions that are different from the user's default permissions (like preferences or application support files). For those apps, you may need to delete their preferences or reinstall the app.

If resetting your home folder permissions doesn't work, then you may need to try restoring from a backup or transferring your data to an external drive.

2
  • I'm trying this right now. So far it's been running for about 12 hours. I have a lot of files :P
    – cisellis
    Mar 9, 2012 at 15:19
  • This did not work. The operation ran for over 48 hours before I gave up and turned it off. It may have finished at some point but there was no way to tell.
    – cisellis
    Mar 12, 2012 at 15:05
3

Run this

cd $HOME
{ sudo chflags -R nouchg,nouappnd ~ $TMPDIR.. ; \
sudo chown -R $UID:staff ~ $_ ; \
sudo chmod -R -N ~ $_ ; \
sudo chmod -R 755 ~ $_ ; \
sudo chmod 700 Desktop Documents Downloads Dropbox Library Movies Music Pictures Sites $_ ; \
sudo chmod 777 Public ; \
sudo chmod 733 Public/Drop\ Box ; \
} 2> /dev/null
2
  • Exactly what I was looking for! Works if you are able to log in to the user in question and that user is also an admin. How about repairing another user’s home directory from another account? (the user with permission issues might or might not be an admin)
    – unom
    Aug 19, 2015 at 17:52
  • Restart the computer using the Cmd+R startup key combination to open the Repair Utility, open Terminal under the Utilities menu, use the command resetpassword, select the hard disk and the relevant user account from the drop-down menu that will open, select reset to reset home directory permissions and ACLs of the selected user account. Aug 20, 2015 at 7:16
2

Your issues are basically the same. There is no standard for permissions for files in your home directory they all depend on their use.

Fixing permissions apps and scripts and OS installs should not affect the user area at all except maybe changing the permissions on the home directory. OS installs and most fix permissions scripts compare the permissions and owners to what is required for a clean install and this has no normal users. If they did I would consider this as a major bug.

The fix is to change the owner of the files ie use of chown on your home directory. The owner should be the new owner name.

There is no general way of getting permissions back as individual files depend on there application and all apps can be different.

Thus the only way is to restore from a backup before the change - do the change as per Apples notes and then chown all the files. Or look at each individual file and work out what permissions it should have - for most files your home directory this should be read/write for the owner and nothing (or read only ) for others. Directories will also need execute permission so that they can be listed. Applications will need other permissions.

3
  • Good. I had just checked my home directory and so very many 777 directories and got worried.
    – nyxee
    Sep 8, 2017 at 1:01
  • @nyxee that is odd I would expect 755 or 700
    – mmmmmm
    Sep 8, 2017 at 17:38
  • very.... I will start editting the permissions one by one very very slowly..
    – nyxee
    Sep 11, 2017 at 4:13
1

We have run into the same issues with several users. After unsuccessfully trying everything regarding fixing permissions, we found a solution. For the sake of clarity, the problematic user's is John Doe and the user account (and home directory) is called "johndoe".

  1. Make sure your root user is enabled. Log out
  2. Log in as root and make a backup of the johndoe home folder (creating a backup of home folder is optional, but strongly recommended in case something goes wrong)
  3. Open System Preferences/Users & Groups
  4. Delete the johndoe user—you will be prompted as to what to do with the johndoe's Home directory
  5. IMPORTANT: Choose NOT to delete the directory
  6. Go to /Users and note that johndoe's folder has been renamed to "john doe (deleted)"; rename the home directory back to "johndoe"
  7. Go back to System Preferences/Users & Groups and recreate John Doe's account
  8. IMPORTANT: Make sure user's Account Name is the "john doe", or exactly what you named the home directory in step 6
  9. You will be prompted that the home directory with that name already exists and if you want to use the existing home directory
  10. Choose yes
  11. Restart and log in as John Doe
1
0

I'm adding a single answer to address everything. Whatever I did with the permissions, it was totally borked. I tried the first answer, booting into Recovery Mode and resetting the permissions via the reset password method, but that ran for 48 hours before I killed it and had no discernable effect. I tried to restore from Time Machine and that actually blew up as well and was unable to restore the backup.

I ended up backing everything up manually to an external disk, formatting the entire disk and reinstalling Lion, reinstalling everything manually, and copying my personal data, such as the iPhoto library and iTunes libraries, back manually. iPhoto had to repair the library but worked fine and I've had no issues. iTunes was unable to add any music to the library until I used Disk Utility to repair permissions again. Since I only copied the iTunes Media directory and not the parent directory, it seemed to fix everything.

Moral of the story: Forget Apple, don't rename users.

0

This is not a permission problem at all! Nothing you do with permissions will fix it because the permissions are already set to read/write, which is as permissive as they can be.

It’s an owner problem; the system is confused about who owns the file, and cannot resolve the quandary. Add yourself as a new owner, give yourself read/write permissions, and then delete the offending “fetching” user.

0

Disk Utility's Reset Permissions feature doesn't affect your home directory, so it won't work here. But it also has a second, hidden permissions reset tool for your home directory. You use it from Terminal, like this:

diskutil resetUserPermissions / $(id -u)

(Source: https://support.apple.com/en-us/HT203538)

You must log in to answer this question.

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