Error Codes Wiki

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

  1. 1Grant Full Disk Access: System Settings > Privacy & Security > Full Disk Access > add Terminal (or iTerm2)
  2. 2Restart Terminal after granting Full Disk Access (permission takes effect on next launch)
  3. 3For cron/launchd scripts: grant Full Disk Access to the interpreter (/bin/bash, /usr/bin/python3)
  4. 4If you need specific access only: grant the narrower permission (Files and Folders) instead of Full Disk Access
  5. 5Never disable SIP to bypass these protections — grant proper permissions instead

Tags

operation-not-permittedtccprivacyfull-disk-accessterminal

More in Security

Frequently 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.