During development and debugging I have changed permissions of various files and folders using chown and chmod on my local system (I didnt maintain the list of changes). Now that I have fixed the issue, i fear of security consequences. Any way I could restore the default permissions and/or find vulnerabilities in terms of network security or other potential loop holes that might create due to my changes.
For system installed packages you can run the following command in Terminal.app to find permissions that differ from the default:
sudo /usr/libexec/repair_packages --verify --standard-pkgs /
If you want to just apply those permissions to your system as a whole, run the following command:
sudo /usr/libexec/repair_packages --repair --verify --standard-pkgs /
Or you could individually fix the permissions that you have changed yourself using chmod/chown.
For everything else, you need to have used either a package manager that can verify permissions, or have a backup you can use for comparing permissions before and after the event.
It depends on your OS.
- Use Disk Utility to reset System permissions.
- Reset Home folder permissions & ACLs using OnyX - Maintenance tab/permissions, tick the box at the top then Execute.
- For belt & braces, apply [or-reapply if already up to date] 10.10.5 using the 10.10.5 combo update, not the delta from App Store
Reset Home folder permissions & ACLs
This has become more complex since El Capitan because of System Integrity Protection, but is still possible by booting to Recovery Mode...
- At boot, hold Cmd ⌘ R at the chimes
- At the recovery screen, open Terminal from the Utilities menu.
- Type in
resetpasswordand hit Return\Enter. A Reset Password window opens.
- Select your username from the drop-down menu labeled Select the user account (NOT System Administrator/root).
- 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, press Cmd ⌘ Q and restart your computer (or Select > Restart from the menu bar). It's very important that you don't hold down the power button to exit the recovery session, or the ACL reset won't be performed.
For belt & braces, apply [or-reapply if already up to date] 10.11.5 using the 10.11.5 combo update, not the delta from App Store
I accidentally changed the ACLs permissions on my home folder and had the same problem on my MacBook Pro running macOS Sierra version 10.12.2
Follow the step below to changed the folders No Access permissions and revert back to Allow access:
Restart with the Command and S keys held down, and run the following commands:
mount -uw / chown root / chmod 1775 / exit
After the last command "exit" your system should restart on its own and everything should appear the same as the time before you changed the Home folder permissions.