You typed ls ~/Desktop or mv in Terminal, and your Mac answered with Operation not permitted. The fastest safe check is to open System Settings > Privacy & Security and see whether Terminal has permission to touch that folder. For a protected user folder, that may be the missing permission. You won’t need to disable System Integrity Protection (SIP) or use sudo.
This guide covers macOS Ventura (13) and later, which use the System Settings app. It shows you how to work out which protection layer is blocking you and how to grant Terminal the smallest permission that fixes it. It also covers the cases that trip people up: iTerm2, VS Code, cron jobs, and SSH sessions.
Quick Reference: Fix Operation Not Permitted in Terminal on Mac
| Scenario | Likely Cause | Recommended Fix |
|---|---|---|
| Error on Desktop, Documents, Downloads, or iCloud Drive | TCC privacy block | Allow Terminal in Files & Folders |
| Error across many folders or in other apps’ data | TCC privacy block | Add Terminal to Full Disk Access |
| Works in Terminal, fails in iTerm2 or VS Code | Permission is per app | Grant the same permission to that app |
sudo doesn’t help | Privacy approval may still be required | Fix the privacy setting instead |
Error on /System, /bin, /sbin, or /usr | SIP protection | Work in a user-writable location instead |
| Script works by hand, fails in cron or launchd | Background process may lack approval | Identify the actual process and check its logs before granting any access |
| Error over SSH | Remote session may lack disk access | Turn on full disk access for remote users |
What “Operation Not Permitted” Means on a Mac
Several protection layers can block a file operation on your Mac. People mix them up all the time, and that confusion is why so many forum posts jump straight to “just disable SIP.”
TCC (Transparency, Consent, and Control) is macOS’s privacy layer. It decides which apps can read or change files in protected places like Desktop, Documents, Downloads, and iCloud Drive. Each app needs its own approval. When Terminal lacks it, you get Operation not permitted, even if your normal file permissions would allow the action. It is one possible cause when protected user data is involved.
SIP (System Integrity Protection) guards core parts of macOS itself. According to Apple’s SIP overview, it protects locations such as /System, /bin, /sbin, and /usr (outside /usr/local). Even the root account can’t modify them. Apple designed SIP to stay enabled, and you should leave it that way.
Unix file permissions are the classic owner, group, and read/write/execute rules. These usually produce Permission denied instead. A locked file can also show Operation not permitted.
If you’re coming from Windows, TCC is the new idea. Windows doesn’t usually ask you to approve an app before it can open your Documents folder. macOS does, and it treats Terminal like any other app.
Quick Diagnosis: Find Which Layer Is Blocking You
Run through these checks before changing anything.
1. Note the exact path and the app
Write down the folder or file in the error and which app ran the command. Terminal, iTerm2, and VS Code each count as different apps.
2. Check where the path lives
If it’s inside your home folder (Desktop, Documents, Downloads, iCloud Drive), TCC is the likely cause. If it starts with /System, /bin, /sbin, or /usr, SIP is the likely cause.
3. Confirm SIP is still on
This command only reads the current status. It changes nothing.
csrutil status
You should see System Integrity Protection status: enabled. That’s the state you want.
4. Look at the file’s permissions and flags
ls -ldeO /path/to/item
Replace /path/to/item with your real path. The output shows the owner, the permission bits, and any file flags. A restricted flag can indicate system protection but does not prove which layer denied this operation. A uchg flag marks user immutability; also inspect ownership, ACLs, and whether the volume is read-only.
Common Issues and Solutions
Problem: Operation Not Permitted in Desktop, Documents, or Downloads
Symptoms:
ls,cp,mv, orrmfails withOperation not permitted- The same file opens fine in Finder
- Adding
sudogives the same error
Why it happens: Terminal hasn’t been granted TCC access to that protected folder.
Fix (try Files & Folders first):
- Choose Apple menu > System Settings.
- Click Privacy & Security in the sidebar. You may need to scroll down.
- Click Files & Folders.
- Find Terminal in the list and click to expand it.
- Turn on the toggle for the folder you need, such as Desktop Folder or Documents Folder. Enter your administrator password if asked.
- Quit Terminal with
Cmd + Q, then open it again.
If Terminal isn’t in the Files & Folders list yet, run the command again. macOS may show a prompt asking whether Terminal can access that folder. Click Allow, and Terminal will appear in the list afterward.
Verification: Run ls ~/Desktop (or your target folder). You should see a file list instead of the error.
Tip: Files & Folders may also include toggles for external drives or network storage, depending on your macOS version. If Terminal can’t write to an external SSD or a USB flash drive, look for a relevant entry in the Files & Folders list.
Problem: Files & Folders Isn’t Enough
Symptoms:
- The folder you need isn’t one of the listed options
- A backup or cleanup script touches many locations, including other apps’ data
Why it happens: Files & Folders only covers specific folders. Some data, like other apps’ containers, needs Full Disk Access.
Fix (Full Disk Access, only when needed):
- Go to System Settings > Privacy & Security > Full Disk Access.
- Click the Add (+) button below the list.
- Open Applications > Utilities, select Terminal, and click Open.
- Make sure the toggle next to Terminal is on.
- Quit and reopen Terminal.
Verification: Rerun the command that failed. It should complete without the error.
Full Disk Access is a big grant. Apple notes that it lets an app read nearly all files on your Mac, including other apps’ data. Any command you paste into Terminal gets that same reach. I’d only use it for tasks that need it, and turn it off afterward.
Tip: For apps that request Full Disk Access or System & App Protection Override, newer macOS versions may prompt for a System & App Protection Override and may offer narrower choices like Choose Folder or Choose Apps instead of Bypass System Protections. This is not a universal Terminal prompt or a replacement for Files & Folders. Pick the narrower option when it is offered. Check System Settings on your Mac for the exact wording, since it varies by macOS version.
Problem: Adding sudo Still Says Operation Not Permitted
Symptoms:
sudo rm ~/Desktop/file.txtfails the same way as withoutsudo
Why it happens: sudo gives you root privileges at the Unix level. TCC can still require privacy approval for protected user data when a command uses root. Attribution depends on the responsible process and operation; Unix privilege alone is not privacy consent.
Fix: Drop sudo and grant Terminal the Files & Folders or Full Disk Access permission described above.
Verification: The command works without sudo after you reopen Terminal.
Problem: The Error Happens on /System or Another Core macOS Path
Symptoms:
- No privacy setting helps
- The path starts with
/System,/bin,/sbin, or/usr ls -ldeOshows therestrictedflag
Why it happens: SIP is protecting that location by design. Apple’s Platform Security guide describes these locations as read-only, even for root.
Fix: Keep SIP on. Don’t run csrutil disable. Turning SIP off puts your Mac in a less secure state and isn’t a supported fix for privacy errors. Instead:
- Put your own tools and files in a writable location such as
/usr/local,/Applications, or your home folder. - Use the software’s documented installer instead of editing a protected path by hand.
Verification: csrutil status still reports enabled, and your task works from the new location.
Problem: A Locked File Blocks Changes
Symptoms:
- The file is in a folder Terminal already has access to
ls -ldeOshowsuchg
Why it happens: The user-immutable flag can block changes. Other causes include system immutability, ACLs, or a read-only volume. Do not remove protection from managed or security-sensitive files.
Fix: In Finder, select the file, press Cmd + I, and uncheck Locked. For a file you own and intend to change, remove only its user-immutable flag in Terminal:
chflags nouchg ~/Documents/example.txt
Verification: Run ls -ldeO again. The uchg flag should be gone.
Problem: Cron or launchd Scripts Fail
Symptoms:
- The script works when you type it into Terminal
- It fails with
Operation not permittedwhen scheduled
Why it happens: Background jobs don’t run inside Terminal, so they don’t inherit Terminal’s approval. Whether the job needs its own TCC approval, and which process needs it, depends on how the job is launched, what resource it touches, and your macOS version.
There’s no single fix that works for every scheduled job. Treat this as something to diagnose rather than a recipe to apply blindly.
Diagnose first:
- Identify exactly what runs the job: cron, launchd, and the specific binary, shell, or interpreter named in the crontab line or the launch agent’s plist.
- Check the job’s own log output, or open Console (in Applications > Utilities), start streaming, let the job run, and search for “TCC” to see which process macOS actually denied.
- Confirm the path the job touches is a TCC-protected location at all. Some failures in scheduled jobs come from working-directory or environment differences, not privacy permissions.
If logs confirm a TCC denial, prefer a narrow fix:
- Run the task from an app you’ve already approved, such as a script you launch manually from Terminal, rather than scheduling it to run unattended.
- Use a user-initiated workflow, like a login item or a manually triggered automation, instead of a background daemon when the job touches sensitive data.
- Only as a last resort, add the specific binary named in your logs to Full Disk Access via System Settings > Privacy & Security > Full Disk Access > Add (+), using
Cmd + Shift + Gto type its path.
Granting Full Disk Access to a system daemon, shell, or interpreter extends that broad access to every job that binary ever runs, including this one and all others. It also may not resolve the error if the responsible process is a different helper or wrapper than the one you added, so confirm the fix actually works before leaving the permission in place.
Verification: Let the job run on schedule and check its log or Console output for the specific process TCC is still denying, if any.
Problem: A Permission Stopped Working After a macOS Update
Symptoms:
- Commands that worked last week now fail
Why it happens: Major updates can reset some privacy approvals or ask for them again.
Fix: Revisit Files & Folders or Full Disk Access and turn Terminal back on. If it’s missing, add it again.
Verification: Reopen Terminal and rerun the command.
Problem: Toggles or Add/Remove Buttons Are Greyed Out
Symptoms:
- You can’t change anything in Privacy & Security
Why it happens: A work or school Mac may be managed with a configuration profile that locks these settings.
Fix: Ask your IT department. A standard account can’t bypass this.
Error Messages Quick Reference
| Error Message | Possible Cause | Where to Look |
|---|---|---|
Operation not permitted in your home folders | TCC privacy block | Files & Folders or Full Disk Access |
Operation not permitted with sudo | TCC still blocking | Same privacy settings, not sudo |
Operation not permitted on /System | SIP protection | Use a different location |
Operation not permitted on a locked file | uchg flag set | Finder Get Info > Locked |
Permission denied | Unix ownership or permission bits | ls -ldeO output |
Read-only file system | Protected system volume | Use a writable location |
Platform-Specific Fixes
On iTerm2 and VS Code
macOS ties every permission to the exact app that ran the command. Fixing Terminal does nothing for iTerm2, and VS Code’s built-in terminal runs under VS Code.
- Go to System Settings > Privacy & Security > Files & Folders (or Full Disk Access).
- Turn on access for iTerm or Visual Studio Code. For Full Disk Access, click Add (+) and choose the app from Applications.
- Quit and reopen that app completely.
You should see the command succeed in that app’s terminal window.
Over SSH (Remote Login)
If you connect to your Mac over SSH and hit the error, the remote session may not have the same disk access as a Terminal window you opened locally and approved. Apple provides a separate setting for remote users, though the exact option and its effect can vary across macOS versions.
- Go to System Settings > General > Sharing.
- Click the Info (i) button next to Remote Login.
- Turn on Allow full disk access for remote users.
Apple’s Sharing guide covers this option. Reconnect over SSH and retry to confirm it worked.
On Older macOS Versions
Before Ventura, the same controls live in System Preferences > Security & Privacy > Privacy. You may need to click the lock icon and enter your password before making changes. The labels can differ slightly by version.
Configuration Issues
Mistake: Granting Full Disk Access first. Start with Files & Folders when the folder you need is listed. Full Disk Access covers far more than one folder.
Mistake: Forgetting to restart the app. The new permission may not apply until you quit with Cmd + Q and reopen. Closing the window isn’t enough.
Mistake: Running recursive permission changes. Commands like sudo chmod -R or sudo chown -R on system folders won’t fix a TCC error, and they can damage your setup. If a single file’s ownership is wrong, fix just that one file.
Mistake: Adding the wrong app. Check which app actually ran the command. A script launched from VS Code needs VS Code approved.
Getting Help
If you’re still stuck, gather this info before asking for help:
- Your macOS version (Apple menu > About This Mac)
- The exact command and the full error text
- Output of
csrutil status - Output of
ls -ldeOfor the failing path - Which app ran the command
You can also open the Console app in Applications > Utilities. Start streaming, reproduce the error, then search for “TCC” to see privacy denials.
For official guidance, see Change Privacy & Security settings on Mac. The Apple Support Community is a good place to post your details. Contact Apple Support if settings won’t save on a Mac you manage yourself.
Prevention Tips
- Grant the narrowest permission: Pick one folder in Files & Folders before reaching for Full Disk Access.
- Revoke access when you’re done: Turn off the toggle in Files & Folders. In Full Disk Access, turn off the toggle or select the app and click Remove (-).
- Review the lists after updates: A quick check after a major macOS update saves confusion later.
- Keep SIP on: Run
csrutil statusnow and then. It should sayenabled. - Use Finder for one-off moves: For a single file copy, Finder avoids the Terminal permission question entirely.
Frequently Asked Questions
What does “Operation not permitted” mean on a Mac?
Usually, it means macOS’s privacy layer blocked Terminal from a protected folder. Less often, it’s SIP or a locked file.
Is this the same as a SIP error?
Usually, no. SIP only covers core macOS locations. Errors in home folders may involve privacy settings, Unix permissions, ACLs, or file flags.
Why doesn’t sudo fix it?
sudo changes Unix privileges; protected-user-data access may still require privacy approval for the responsible process.
Where exactly do I grant Terminal permission?
System Settings > Privacy & Security > Files & Folders or Full Disk Access.
Files & Folders or Full Disk Access?
Files & Folders gives access to specific folders like Desktop or Downloads. Full Disk Access covers nearly everything. Pick Files & Folders when it covers your folder.
Why does iTerm2 or VS Code still fail?
Each app needs its own approval. Grant the permission to that app, then restart it.
Why do my cron or launchd scripts still fail?
They run outside Terminal, and which process needs TCC approval depends on how the job is launched. Check the job’s logs or Console for the actual process macOS denied, then grant the narrowest access that resolves it.
If possible, run the task from an already-approved app instead of scheduling it as an unattended background job.
Is it safe to disable SIP to make this go away?
No. Apple recommends keeping SIP on, and disabling it won’t fix a TCC error anyway.
How do I undo the permission?
Turn off the app’s toggle, or select it in Full Disk Access and click Remove (-).
Wrapping Up
You can now tell a privacy block from a SIP block or a plain file permission problem, and fix each with the smallest change. In my view, Files & Folders handles the everyday cases well, and Full Disk Access is worth turning off once your task is done.
| Step | Action | Applies To |
|---|---|---|
| 1 | Check the path and the app | All cases |
| 2 | Allow the folder in Files & Folders | Home folders, external drives |
| 3 | Add the app to Full Disk Access if needed | Broad scripts, app data |
| 4 | Approve iTerm2, VS Code, or cron separately | Third-party apps, background jobs |
| 5 | Confirm csrutil status shows enabled | Every Mac |
If the error comes back after you’ve granted the right permission and restarted the app, check for a management profile or an update reset. If settings still won’t stick on your own Mac, contact Apple Support.
Last updated: 2026-11-24 | Applies to Terminal, iTerm2, and VS Code on macOS Ventura (13) and later