macOS

Changing File Permissions in macOS: Commands and Methods

This guide explains how to manage access permissions for files and folders in macOS using Terminal (chmod command) and the Finder graphical interface. You will learn to grant, restrict, and reset permissions for users and groups.

Updated at February 15, 2026
5-10 minutes
Easy
FixPedia Team
Применимо к:macOS Sonoma 14macOS Ventura 13macOS Monterey 12macOS Big Sur 11

Introduction / Why This Matters

File permissions in macOS determine which user or group can read, modify, or execute a specific file or folder. They are absolutely critical for system security and proper software operation. Incorrect permissions can lead to "Access Denied" errors, software malfunctions, or data leaks. This guide will show you how to quickly and safely change permissions using two primary methods: via the command line (more powerful) and through Finder (convenient for simple cases).

Prerequisites / Preparation

  1. Administrator privileges: To change permissions on files you don't own or in system directories, you'll need an administrator password.
  2. Access to Terminal: The Terminal app is located in /Applications/Utilities/ or can be found via Spotlight (Cmd+Space).
  3. Understanding basic permissions: Know who the file's owner is (owner, group, others) and what the letters r (read), w (write), x (execute) mean.

Step 1: Determine Current Permissions

Always check current permissions before making any changes. This helps you understand exactly what needs to be modified.

  1. Open Terminal.
  2. Navigate to the directory containing the file or specify the full path. For example:
    cd ~/Documents
    
  3. Run the ls -l command with the filename:
    ls -l myfile.txt
    
    The output will look similar to:
    -rw-r--r--  1 user  staff  1234 15 Feb 10:30 myfile.txt
    
    The string -rw-r--r-- represents the permissions:
    • - (file type: - for regular file, d for folder).
    • rw- (owner: read + write).
    • r-- (group: read only).
    • r-- (others: read only).

Step 2: Change Permissions via Terminal (the chmod command)

This is the most flexible and precise method. The chmod (change mode) command works with numeric (octal) or symbolic modes.

Method A: Symbolic Mode (easier to understand)

Use the characters u (user/owner), g (group), o (others), a (all) and the operators + (add), - (remove), = (set exactly).

  • Add execute permission (x) for the owner:
    chmod u+x script.sh
    
  • Remove write permission (w) from group and others:
    chmod go-w important.doc
    
  • Give full permissions (rwx) to owner, read and execute to group and others:
    chmod u=rwx,go=rx program
    

Method B: Octal (Numeric) Mode (fast and precise)

Assign a three-digit number to each class (owner, group, others), where:

  • 4 = read (r)
  • 2 = write (w)
  • 1 = execute (x)
  • 0 = no permissions

The sum of these values gives the final digit. The most common example is 755:

  • 7 (4+2+1) = rwx for owner.
  • 5 (4+0+1) = r-x for group.
  • 5 (4+0+1) = r-x for others.

Example commands:

# Standard permissions for an executable script/program
chmod 755 myscript.sh

# Only the owner can read and write (private file)
chmod 600 private.key

# Full access for everyone (use with caution!)
chmod 777 public_share.txt

Changing permissions on a folder recursively: Add the -R (recursive) flag to apply permissions to all nested files and folders.

chmod -R 755 my_folder/

⚠️ Important: Recursively changing permissions, especially to 777, can create serious security vulnerabilities. Apply only to specific shared folders.

Step 3: Change Permissions via Finder (Graphical Interface)

This method is suitable for simple operations and doesn't require memorizing codes.

  1. In Finder, locate the desired file or folder.
  2. Right-click on it (or Control-click) and select "Get Info". Alternatively, select the file and press Cmd+I.
  3. At the bottom of the "Get Info" window, find the "Sharing & Permissions" section.
  4. Click the lock icon in the bottom-right corner and enter an administrator password to make changes.
  5. You'll see a list of users and groups. Next to each name is a dropdown menu with permission levels:
    • Read & Write — full access.
    • Read Only — view and copy.
    • Write Only — only add/modify (for folders like "Trash").
    • No Access — complete denial.
  6. Select the appropriate access level for each user/group.
  7. To apply permissions to all enclosed items (if it's a folder), click the "Apply to enclosed items" button. This option is not available for all file types and may not work for some system files.

Step 4: Verify the Result

After making changes, ensure everything works as intended.

  • Via Terminal: Run ls -l <file> again and compare the permission string to your desired setting.
  • Via Finder: The "Get Info" window should display the new settings.
  • Practical test: Try performing an action as another user (or in Guest mode)—open, edit, or run the file. It should succeed or be denied according to the new permissions.

Common Issues

"Operation not permitted" error in Terminal

  • Cause: You're trying to change permissions on a system file or folder protected by System Integrity Protection (SIP). You may also lack ownership rights.
  • Solution:
    1. Ensure you're not trying to modify files in /System, /usr (except /usr/local), /bin, /sbin, and other protected directories. SIP does not interfere with user files.
    2. If you need to change permissions on a system file (e.g., for development), you'll need to temporarily disable SIP. Do this via Recovery Mode (restart, hold Cmd+R), launch the Terminal utility, and run csrutil disable. After rebooting, change the permissions, then re-enable SIP (csrutil enable) for security.
    3. Check if you are the file's owner (ls -l shows your name in the third column). If not, use sudo chown to change ownership before running chmod.

Permissions in Finder don't change for some files

  • Cause: Finder uses extended attributes (ACLs) and may not display all details set via chmod. For system files or files owned by root, the Finder interface is limited.
  • Solution: Use Terminal and the chmod command for full control. To view ACLs, use ls -le.

File stops working after permission change

  • Cause: Some programs (especially executables or scripts) require specific permissions. For example, a script without execute (x) permission won't run.
  • Solution: Set the permissions recommended by the software vendor. Often, executables use 755, configuration files 644. If unsure, check documentation for your specific program.

Recursive change (chmod -R) affected wrong files

  • Cause: An error in the path or using * without accounting for hidden files (starting with .).
  • Solution: Always verify the path before running chmod -R. Use ls -la to display all files, including hidden ones. To change permissions only on files (not folders), combine with find: find /path/ -type f -exec chmod 644 {} \;.

F.A.Q.

How does the chmod command differ from permission settings in Finder?
What to do if 'Operation not permitted' appears when changing permissions?
How to reset all file access permissions to default?

Hints

Check current permissions
Change permissions via Terminal (chmod)
Change permissions via Finder (graphical method)
Verify the result
FixPedia

Free encyclopedia for fixing errors. Step-by-step guides for Windows, Linux, macOS and more.

© 2026 FixPedia. All materials are available for free.

Made with for the community