Yes, you can repair disk permissions from the command line on macOS using the diskutil command, specifically diskutil resetUserPermissions for the home folder or diskutil repairPermissions on older macOS versions (pre-El Capitan). This article explains the command-line methods, what they actually do, when you should use them, and how they compare to the GUI tools like Disk Utility and First Aid.
Background: What Are Disk Permissions?
Disk permissions are metadata on every file and folder that controls who can read, write, or execute it. On macOS, each item has an owner, a group, and a set of permission bits (read, write, execute) for each. These permissions are essential for the operating system to function correctly—for example, the System folder must be readable only by system processes, while your home folder should be accessible only to you.
When permissions get corrupted—often due to a failed software update, a crash during installation, or manually changing ownership—apps may crash, files may become unreadable, or the system may behave erratically. The repair process resets these permissions back to the factory defaults for the selected volume or folder.
How the Command-Line Repair Works
On macOS versions up to OS X 10.10 Yosemite, the command diskutil repairPermissions / would scan the entire startup volume and compare every file’s permissions against a database of expected values stored in /var/db/Receipts. It then reset any mismatches to the correct values. This was a slow, thorough process that could take 15–30 minutes on older hard drives.
Starting with OS X 10.11 El Capitan, Apple removed repairPermissions because the new System Integrity Protection (SIP) automatically protects system files from modification. Instead, the only remaining command-line option is diskutil resetUserPermissions, which resets permissions on a specific user’s home folder to the default values. This is useful when a user’s home directory permissions have become messed up, causing login issues or app crashes.
How to Run the Command
To repair permissions on the entire volume (macOS 10.10 or earlier), open Terminal and run:
diskutil repairPermissions /
To reset a user’s home folder permissions (macOS 10.11 and later), you need to know the user’s short name (the one that appears in the home folder path). Then run:
diskutil resetUserPermissions / username
For example, if your username is jdoe, the command would be:
diskutil resetUserPermissions / jdoe
Both commands require administrator privileges, so you may need to prefix them with sudo and enter your password. The command will output a list of files it is processing and finish with a summary.
When Should You Use the Command Line?
The command-line method is most useful in these situations:
- You are comfortable with Terminal and want a quick, scriptable way to reset permissions.
- The GUI Disk Utility fails or is not available (e.g., in Recovery Mode, you can open Terminal from the Utilities menu).
- You need to reset permissions for a specific user’s home folder, which the GUI does not offer as a direct option.
- You are automating maintenance tasks with a shell script.
For most everyday users, the GUI method—opening Disk Utility, selecting the startup disk, and clicking First Aid—is simpler and covers more than just permissions (it also checks the file system structure). However, First Aid does not reset user home folder permissions; it only repairs the volume’s file system metadata.
Common Problems and Misconceptions
A frequent misconception is that repairing permissions will fix all macOS problems. In reality, it only addresses a narrow set of issues related to file ownership and permission bits. It will not fix kernel panics, hardware failures, or most app-specific crashes. Apple removed the full-volume repair because SIP makes it largely unnecessary—system files are automatically protected and repaired as needed.
Another common issue is running diskutil resetUserPermissions on the wrong user or on the wrong volume. The command expects the volume path as the first argument and the username as the second. If you omit the username, or use the wrong one, you may get an error or reset the wrong folder. Always double-check the username with the whoami command or by listing the contents of /Users.
Also, note that repairPermissions on old macOS versions could take a long time and might appear to hang. It is normal for it to process thousands of files; do not interrupt it unless you have to, as an interrupted repair can leave permissions in an inconsistent state.
Alternatives: GUI and Recovery Mode
If you prefer not to use the command line, here are the main alternatives:
- Disk Utility (GUI): Open Disk Utility, select the volume, and click First Aid. This checks and repairs the file system structure, but does not reset user permissions.
- Recovery Mode: Restart your Mac and hold Command-R to enter Recovery Mode. From there, you can open Disk Utility or Terminal. Running
diskutil resetUserPermissionsfrom Recovery Mode is often the only way to fix a home folder that is so broken you cannot log in. - Reinstall macOS: For severe permission issues that persist, reinstalling macOS over the existing system (without erasing your data) will rebuild system permissions from scratch. This is a heavier approach but is more comprehensive.
Safety and Precautions
Repairing permissions is generally safe, but there are a few things to keep in mind:
- Always back up your important data before running any disk repair, especially if you are using Recovery Mode.
- Do not run
repairPermissionson a volume that is not your startup disk, as it may not have the correct permission database. - If you are using macOS 10.11 or later, do not try to manually chown system files—SIP will block it and may cause more problems.
- If you are unsure about a command, look it up in the man page (
man diskutil) before running it.
Frequently Asked Questions
Does repairing permissions delete my files?
No, repairing permissions only changes the permission metadata on files and folders. It does not delete or modify the content of your files. However, if a file has incorrect permissions, it may become inaccessible until the repair is complete, so it is still wise to have a backup.
Why is the repairPermissions command not found on my Mac?
If you are running macOS 10.11 El Capitan or later, Apple removed the repairPermissions command because System Integrity Protection makes it obsolete. Use diskutil resetUserPermissions instead, or use Disk Utility’s First Aid for file system checks.
Can I repair permissions on an external drive?
Yes, you can run diskutil repairPermissions on an external drive on older macOS versions, but it will only work if the drive contains a full macOS installation with the permission database. On newer macOS, resetUserPermissions can be pointed at an external drive, but it only resets the specified user’s home folder on that drive.
What is the difference between repairing permissions and First Aid?
Repairing permissions (or resetting user permissions) specifically resets file ownership and permission bits to defaults. First Aid checks and repairs the file system structure—like the directory tree, free space, and volume header. They address different problems; you may need both.
How long does the command take?
On older macOS, repairPermissions could take 15–30 minutes on a large hard drive. The newer resetUserPermissions is much faster, usually under a minute, because it only processes the home folder of one user.
Is it safe to run as sudo?
Yes, both commands require administrator privileges, so using sudo is expected. However, be careful not to run other commands with sudo unless you understand what they do, as sudo gives you full system access.
Related
Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.
More cards in this drawer
- Business partnership due diligence checklist what to verify before you sign?
- Does the FCC Protect Internet Privacy?
- Disaster Robbers Codes? Meaning & Origin
- Repair a Disk with Mac Disk Utility
- Sharp Smart TV TiVo OS Available February?
- Streamlabs Stream Boss: Setup Guide