Operation Not Permitted in Terminal — macOS Privacy Permission Denied Error
Warningsecurity
Overview
Fix 'Operation not permitted' errors in Terminal and command-line tools caused by macOS privacy protections blocking access to protected directories.
Key Details
- macOS TCC (Transparency, Consent, and Control) protects sensitive directories and resources
- Terminal, iTerm2, and other CLI tools need Full Disk Access to access Desktop, Documents, Downloads, and more
- Even with sudo (root), TCC restrictions still apply — SIP and TCC override root privileges
- Protected locations include: ~/Desktop, ~/Documents, ~/Downloads, Mail data, Safari data, Time Machine backups
- This protection was introduced in macOS Mojave and has been strengthened in each subsequent release
Common Causes
- Terminal app not granted Full Disk Access in Privacy & Security settings
- Script or tool trying to access TCC-protected directories without proper entitlements
- Homebrew, Node.js, or Python scripts accessing protected user directories
- Cron jobs or launchd scripts running without Full Disk Access permissions
Steps
- 1Grant Full Disk Access: System Settings > Privacy & Security > Full Disk Access > add Terminal (or iTerm2)
- 2Restart Terminal after granting Full Disk Access (permission takes effect on next launch)
- 3For cron/launchd scripts: grant Full Disk Access to the interpreter (/bin/bash, /usr/bin/python3)
- 4If you need specific access only: grant the narrower permission (Files and Folders) instead of Full Disk Access
- 5Never disable SIP to bypass these protections — grant proper permissions instead
Tags
operation-not-permittedtccprivacyfull-disk-accessterminal
More in Security
windows-defender-errorsWindows Defender Errors — Antivirus Not Working or Updating
Errorwindows-error-0x80073b01-defender-serviceWindows Error 0x80073B01 — Windows Defender Service Failed to Start
Errorwindows-bitlocker-recovery-key-errorsBitLocker Recovery Key Errors — Drive Locked and Recovery Key Not Found
Criticalmac-gatekeeper-app-blockedMac Gatekeeper — App Cannot Be Opened (Unidentified Developer)
Warningmac-filevault-recovery-errorsMac FileVault Errors — Encryption, Decryption & Recovery Key Issues
Errormac-keychain-errors-passwordsMac Keychain Errors — Password Prompts, Locked Keychain, and Repair Guide
WarningFrequently Asked Questions
macOS TCC (Transparency, Consent, and Control) operates at a level above Unix permissions. Even root cannot bypass TCC without proper entitlements. This is enforced by System Integrity Protection (SIP) and the TCC database.