Resetting home folder permissions

There are instances where users may change the permissions of files and folders on their computers, which can result in file access errors.

There are instances where users may change the permissions of files and folders on their computers, which can result in file access errors.

Apple Discussions poster mlevack writes:

"After a Hard Drive failure, I [ran] a fresh installation...and copied all of my documents into my new home folder, but the ownerships and permissions are wrong. I have to "Get Info" for every file or folder and add myself as an owner with read / write permissions. VERY time consuming."

In OS X there are two areas where permissions problems can occur. The first is with system files, located either in the "System" directory or global "Library" folder at the root of the drive, and the second is in users' home directories. Sometimes users will reorganize their files, or manually migrate to a new computer and somehow alter the permissions on files. While it is simple to reverse permissions alterations on individual files, if users have used the Finder's "Apply to enclosed items" feature to propagate their permissions then fixing the permissions can be very hard to do. This is where many problems start, because users will not know how many files were changed, and what their original permissions were.

In order to tackle these problems, OS X comes with utilities that can help revert the permissions on both the system as well as in home directories; however, in some cases users must first clear faulty permissions before using these utilities.

Fixes

Use Disk Utility to Fix System Permissions Disk Utility can access the global permissions database which stores all the default permissions for Apple-provided system files. If users have manually copied files within their System folder (such as kernel extensions), Disk Utility's "Permissions Repair" routine can easily restore the proper permissions on these files. It is recommended to first try the permissions repair when booted into Safe Mode, but alternatively users can boot from their installation DVD and run it from there.

Remove ACLs on Home Folders and restore them using the Leopard DVD Disk Utility's Permissions Repair will not change files within the user's home folder, so if a user has propagated incorrect permissions in this folder the first step will be to remove access control lists (ACLs), and then set them back up using the password utility on the Leopard DVD. Some users have tried this without first removing ACLs, and have run into problems. To remove ACLs, open the "Terminal" application (located in the "Utilities" folder) and enter the following command:

sudo chmod -RN ~

Then users should run the following command to ensure the files in the home folder have them as the owner by running this command:

sudo chown -R `id -un` ~

NOTE: these commands should be run when users are logged into the affected account.

After supplying a password and allowing these commands to run, users should boot off the Leopard DVD, and after selecting a language, choose "Reset Password" and select the boot drive. Then select the user account that's affected and click the "Reset" button in the "Reset Home Directory Permissions and ACLs" section. After this has run, quit the installer and restart the system.

Resources
  • mlevack
  • More from Late-Breakers
  •  

    Join the discussion

    Conversation powered by Livefyre

    Show Comments Hide Comments