Operation not permitted in Terminal on Mac: check Privacy settings before chmod
Frank Zhang
- 4 minutes read - 1892 wordsTL;DR
The title sentence is often the system refusing a protected folder to this app. Separate it from Permission denied and from System Integrity Protection on system paths. Do not start with chmod, and do not turn SIP off.
Match Operation not permitted before you run chmod, raise privileges with sudo, or turn off System Integrity Protection. This page is general guidance, not a record of one session. The commands were not re-run on a Mac for this page. No session on this site has this error on screen. The sources are Apple support pages read on 2026-11-25, plus the usual POSIX errno strings named below. If man, the labels in System Settings, or the text on the machine in front of you disagrees, that copy wins.
Terminal on a Mac prints a path with the sentence:
ls: PATH: Operation not permitted
PATH is the file or directory that was refused. People paste the English string after ls, du, or find on Downloads, Desktop, or Documents, or after ls . once they have already cd’d into one of those folders.
Linux prints the same EPERM sentence. This page covers a terminal app on a Mac reaching a user folder or a system path. It is not Permission denied, not SSH’s Load key …: Operation not permitted, and not the UNPROTECTED PRIVATE KEY FILE warning.
In ordinary POSIX strings, Operation not permitted is EPERM and Permission denied is EACCES. The sentence alone does not identify which protection refused the call. Use the path, whether the app itself is authorized, and whether the refusal survives sudo.
Start with read-only checks. Do not change modes first. Do not turn security features off.
What this page is for
Match Operation not permitted from ls, du, find, cat, or rm, usually on Downloads, Desktop, or Documents in the home folder, or on Mail, Messages, or Safari data. Autocomplete such as macos root operation not permitted and mac sudo operation not permitted is often the same question: why did raising privileges not help.
This page does not cover:
Permission deniedorPermission denied (publickey). The latter is the publickey note.WARNING: UNPROTECTED PRIVATE KEY FILE/Permissions are too open. That warning is the private-key note.Load key …: Operation not permitted. That is a different sentence about opening a key file. This page does not diagnose that path.
Three refusals, before chmod
Controlling app access to files in macOS, as read on 2026-11-25, says that in macOS 10.15 or later the system enforces user consent before apps access files in Documents, Downloads, Desktop, iCloud Drive, and network volumes. In macOS 10.13 or later, apps that require access to the full storage device must be explicitly added in System Settings (macOS 13 or later) or System Preferences (macOS 12 or earlier).
Control access to files and folders on Mac, read the same day, says some apps and websites can access files in the Desktop, Downloads, and Documents folders, and that you can turn each listed app’s access to specific locations on or off under Apple menu > System Settings > Privacy & Security > Files & Folders.
Change Privacy & Security settings on Mac, from the same reading, describes Full Disk Access more broadly: it allows apps to access all files on the computer, including data from other apps (for example, Mail, Messages, Safari, and Home), data from Time Machine backups, and certain administrative settings for all users on this Mac. To add an app, click the add control, select the app, then click Open.
That is the first branch: privacy access granted to an app, not the rwx mode on the file. chmod changes POSIX permissions. It does not put Terminal on either of those lists.
The second branch is ordinary POSIX permissions or a file lock. If the path is not one of those protected locations, ls -l may already show that the owner or mode denies the current user. Finder’s Get Info window also shows Sharing & Permissions; see Apple’s Change permissions for files, folders, or disks on Mac. This is the branch where chmod or a change of owner belongs. Do not use it to repair the first branch.
The third branch is System Integrity Protection (SIP). About System Integrity Protection on your Mac, read on 2026-11-25, says SIP restricts the root user account and limits what root can do on protected parts of the operating system. Those parts include /System, /usr, /bin, /sbin, /var, and apps pre-installed with macOS. Paths that third-party apps and installers can still write to include /Applications, /Library, and /usr/local. Operation not permitted when modifying /System or /usr/bin, even with sudo, matches that description. This page does not explain how to turn SIP off.
Read-only: look at the path first
Replace PATH with the path on the screen. Quote it if it contains spaces. These three commands only read.
ls -ld 'PATH'
ls -lO 'PATH'
csrutil status
ls -ldshows the owner and mode of that directory or file. Downloads, Desktop, and Documents in your home folder are often already yours, and often already readable. If that line shows you as the owner and a mode that should allow a read, and the command still printsOperation not permitted, do not start withchmod. Check privacy access for the app that ran the command.ls -lOis the usual macOSlsflag for file flags (capital O).uchgmeans the user immutable flag is set. That is not the same as a Files & Folders approval. Confirm whether you meant to lock the item. This page did not re-runls -lO; if yourlsrejects-O, theman lson the machine wins.csrutil statusis only a read of whether SIP is enabled. Do not run any command here that disables SIP. If the command is missing, or the wording differs, the copy on the machine wins.
You can also open the same folder in Finder. If you only wanted to see that the files are still there, Terminal is not required.
If the current working directory is already inside a protected folder, ls . can print the same sentence. Check pwd before assuming a broken ls.
First branch: approve the terminal app you are using
Access is granted to an app, not to your login name. Terminal, iTerm2, Warp, and the terminal inside VS Code or Cursor are different apps. Approving Terminal does not approve another terminal app. If a command works by hand and fails in a scheduled job or in a different app, check the app that corresponds to that process.
If the path is Desktop, Downloads, or Documents, start with the narrower list:
- Choose Apple menu > System Settings, then click Privacy & Security in the sidebar (you may need to scroll down).
- Click Files & Folders.
- Find the app that ran the command and turn on access to the relevant location.
Those are the steps in the Files & Folders page above. On macOS 12 or earlier, the same options live in System Preferences > Security & Privacy > Privacy.
If the path is Mail, Messages, Safari data, Time Machine backups, or another app’s data, the narrower list may not be enough. That is the Full Disk Access list. If an app asks for Full Disk Access or System & App Protection Override on your Mac, read the same day, is blunt: when you give an app Full Disk Access instead of choosing only specific protected folders, it can bypass system protections and access all of the files on your Mac, including messages, emails, photos and videos, and data from other user accounts; it can read, change, delete, and export this data without asking. The page is dated 17 November 2026 and says that starting in macOS 27.3, some apps that ask for this access can be limited to specific protected folders. Apple’s advice is to choose only the folders the app needs, and to grant Full Disk Access only when you are certain the app is from a trustworthy source and actually needs that level of access.
If the terminal app is not yet on the Full Disk Access list, follow the Privacy & Security page: click add, select the app, click Open, and confirm the switch is on. macOS may ask for a password or Touch ID.
After you change the list, if the same already-open window still fails the read-only command, fully quit that terminal app, open it again, and retry the read-only command. That relaunch step was not verified on a machine for this page; treat it as general guidance. Do not start by repeating rm or another command that changes files.
On a managed Mac, the switches may be greyed out. Do not bypass a management policy. Ask the administrator of that Mac.
Why sudo often does not help
sudo changes the user the command runs as. The lists above add an app. Neither Full Disk Access nor Files & Folders is updated just because you typed sudo in the same window.
If the path is in a SIP-protected part of the system, Apple already says root is restricted. sudo may still print Operation not permitted. That is not a reason to turn SIP off. It is a reason to stop: the command may be trying to change a location you should not change.
If sudo ls happens to print a listing, do not read that as “use sudo for the home folder from now on.” The fix for the first branch is to approve the right app, not to run everyday ls as root.
Second branch: when it really is a mode or a lock
Only if the path is not in the privacy-protected locations above, and ls -ld already shows that the current user should not read or write it, treat it as a POSIX permissions problem. Use Sharing & Permissions in Finder’s Get Info window, or make the smallest change to the path in the message. Do not chmod 777 the home folder to make one ls succeed.
If ls -lO shows uchg, check whether the item is locked in Finder’s Get Info window. Unlock it only if you intended to change it. This page does not make clearing a lock the default step.
Third branch: Operation not permitted on a system path
A refused write under /System, /usr (except /usr/local), /bin, /sbin, or /var is expected under SIP. Reading those paths is not the main subject of this page; a failed write should be checked against the SIP article. Do not turn SIP off to make a command go green. Third-party software should write to allowed locations such as /usr/local, /Applications, or /Library.
Where this page stops
- The commands were not re-run on a Mac for this page. There is no first-hand screenshot. The sources are the Apple pages dated above.
- This page does not document turning SIP off, editing system files after doing so, or disabling privacy protections.
- This page does not treat Full Disk Access as the default first step. If Files & Folders can cover the path, start there.
- This page does not diagnose
Load key …: Operation not permitted, and it does not treat Linux EPERM under the same name. - Search volume. This page does not add an external measurement.
Other paths on the site start at Start Here. The Chinese writeup is ls: Operation not permitted:Mac Terminal 里先分清隐私许可和 chmod.
If this post helps, you can sponsor the blog. This is voluntary personal support, not a charitable donation.