Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

Fix Operation Not Permitted Mac Terminal Without Disabling SIP

· 6 min read · Home Tech

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

Yes, you can fix many “Operation not permitted” errors in Terminal on macOS without disabling System Integrity Protection (SIP). The error usually appears because Terminal lacks Full Disk Access, or because macOS’s privacy protections are blocking access to folders like Desktop, Documents, Downloads, or external drives. The fix is to grant Terminal the necessary permissions in System Settings, not to turn off SIP. This guide walks you through the safest, most effective steps.

What You'll Need

  • An administrator account on your Mac (you’ll need to enter your password).
  • Access to System Settings (macOS Ventura or later) or System Preferences (macOS Monterey and earlier).
  • Your Mac’s username and password for authentication.

Step-by-Step

  1. Identify the exact file or folder causing the error. Run your command again and note the path. For example, if you get “Operation not permitted” when trying to access ~/Documents, that’s the folder you need to grant access to.
  2. Open System Settings (or System Preferences). Click the Apple menu in the top-left corner, then select System Settings (macOS Ventura and later) or System Preferences (macOS Monterey and earlier).
  3. Navigate to Privacy & Security. In System Settings, click Privacy & Security in the sidebar. In System Preferences, click the Security & Privacy icon.
  4. Select Full Disk Access. Scroll down in the Privacy & Security pane and click Full Disk Access. If the list is locked, click the padlock icon and enter your administrator password.
  5. Add Terminal to the list. Click the + button (or the plus sign under the list). A file picker will open. Navigate to Applications > Utilities, select Terminal, and click Open. If Terminal is already in the list, skip to step 7.
  6. Enable Full Disk Access for Terminal. Once Terminal appears in the list, make sure its toggle (or checkbox) is turned on. If you’re using System Preferences, check the box next to Terminal.
  7. Quit and reopen Terminal. For the permission to take effect, you must completely quit Terminal (press Command+Q) and then reopen it. Simply closing the window is not enough.
  8. Test your original command. Run the same command that previously failed. It should now work without the “Operation not permitted” error.
  9. If the error persists, also grant access to the specific folder. Some folders (like Desktop, Documents, Downloads) are protected separately. Go back to Privacy & Security and select Files and Folders (or Files & Folders in System Preferences). Find Terminal in the list and enable access to the folders you need (e.g., Desktop, Documents, Downloads).
  10. For external drives or network volumes: If the error occurs on an external drive or network share, you may need to grant Terminal access to that volume. In Full Disk Access, click the + button, then navigate to the external drive or volume, and select it (not just a folder inside). This gives Terminal full access to that volume.

Common Mistakes

  • Not quitting Terminal completely: Permissions changes only apply after Terminal is fully quit and reopened. Closing the window doesn’t suffice.
  • Granting access to the wrong app: Make sure you’re adding Terminal (the app in /Applications/Utilities) and not a third-party terminal emulator or a script.
  • Only granting Full Disk Access but not Files and Folders: Some folders require both permissions. Check both sections.
  • Forgetting to unlock the settings: If the list is greyed out, you haven’t authenticated. Click the padlock and enter your password.
  • Assuming SIP is the culprit: Most “Operation not permitted” errors are due to privacy permissions, not SIP. SIP is rarely the cause for file access errors.

Tips

  • Use the exact path: When testing, use the full path (e.g., ls ~/Documents) to avoid ambiguity.
  • Restart after making changes: If the permission doesn’t take effect after quitting Terminal, try restarting your Mac. This is a safe, simple step.
  • Check for other privacy toggles: Some apps, like iCloud Drive, may have separate toggles under Privacy & Security > Files and Folders. Ensure those are enabled if needed.
  • Use Terminal’s built-in help: If you’re unsure about a command, type man command to see the manual. This won’t fix permission errors, but it helps you understand what the command does.
  • Keep macOS updated: Privacy settings can change between macOS versions. Updating to the latest version can resolve bugs that cause permission issues.

Troubleshooting

If the steps above don’t resolve the issue, try these in order:

  1. Check if the error is specific to a command: Some commands (like sudo or find) may have their own restrictions. Try a simpler command like ls ~/Documents to see if the permission is the issue.
  2. Reset Terminal’s permissions: Remove Terminal from Full Disk Access, quit Terminal, then add it back and re-enable. This sometimes clears stale permission states.
  3. Check if the file/folder has restrictive permissions: Use ls -l to see the file’s permissions. If the owner is not your user, you may need to change ownership with chown (requires admin). For example: sudo chown -R $(whoami) /path/to/folder. Be careful with this command—only use it on files you own or have permission to change.
  4. Verify SIP is actually enabled: Run csrutil status in Terminal. If it says “enabled,” SIP is on. If it says “disabled,” then you may have disabled it previously—but you should still not need to disable it for this fix. If SIP is disabled, re-enable it by booting into Recovery Mode and running csrutil enable (this is safe and recommended).
  5. Try a different terminal app: If Terminal itself is corrupted, try using a third-party terminal like iTerm2 (download from the official site). Grant it the same permissions. If that works, the issue is with Terminal’s settings, not macOS.
  6. If all else fails, create a new user account: Sometimes a user’s privacy database gets corrupted. Create a new administrator account in System Settings > Users & Groups, log into it, and test Terminal. If it works, you can migrate your files. This is a last resort, but it doesn’t require disabling SIP.

Frequently Asked Questions

Why do I get “Operation not permitted” even after granting Full Disk Access?

Usually because Terminal wasn’t fully quit and reopened, or because the specific folder (like Desktop) also needs the “Files and Folders” permission. Double-check both settings and restart Terminal.

Is it safe to disable SIP to fix this?

No. Disabling SIP reduces macOS security and can make your system vulnerable to malware. The methods above are safer and work for almost all cases. Only disable SIP if you have a specific, advanced need and understand the risks.

Will this affect my ability to use sudo?

No. Granting Full Disk Access to Terminal does not change sudo behavior. It only allows Terminal to access protected files and folders.

Does this work on Apple Silicon (M1/M2/M3) Macs?

Yes, the steps are identical on both Intel and Apple Silicon Macs. The privacy settings are the same.

What if I’m using a third-party terminal like iTerm2?

The same steps apply. Instead of adding Terminal, add iTerm2 (or whatever terminal app you use) to Full Disk Access and Files and Folders.

Can I grant Full Disk Access to a specific script instead of Terminal?

Yes, you can add any executable or script to Full Disk Access, but it’s easier to grant Terminal access and run the script from Terminal. If you need a script to run automatically, you can add the script itself, but note that it must be a .app bundle or an executable binary.