Home > How to Tips

How to Fix When Terminal Says "Operation not permitted" on Mac

Updated on Friday, June 14, 2024

iBoysoft author Amanda Wong

Written by

Amanda Wong
Professional tech editor

Approved by

Jessica Shee

English Français Deutsch

Summary: Unable to run command in Mac Terminal with the "Operation not permitted" error message? Here, we will explain why and provides solutions to solve this error on macOS Ventura/Monterey/Big Sur.

operation not permitted Mac Terminal

Terminal, a built-in macOS utility, is a good helper for Mac users to access the text-based operating system. By using some command lines in the Terminal, you can easily view the directories of the user account, manage processes, erase the startup disk, etc. What's more, it is greatly useful to run iBoysoft Data Recovery in macOS Recovery with Terminal to recover data from unbootable Macs. 

But the Terminal says "Operation not permitted" or "zsh: command not found" after you enter the command such as ls and kill process, what does it mean? Quite a few Mac users encounter this Terminal error in macOS Mojave and later versions, even the latest macOS Ventura. Keep reading to know why the operation is not permitted and how to fix it.

Why does Terminal say Operation not permitted

Some Mac users report that the Terminal works well on macOS High Sierra and earlier versions, but they receive the error message "Operation not permitted" after they update macOS to Mojave, Catalina, Big Sur, Monterey, or Ventura. This is because of the new security feature - Full Disk Access. 

Full Disk Access requires applications to be granted full permissions to access user-protected files, for other ungranted applications, some data on Mac will be not accessible. And on macOS 10.13 and earlier, the Full Disk Access permission is automatically granted during the installation of the apps.

In addition to the Full Disk Access, the "Operation not permitted" error may be caused by another macOS feature - SIP(System Integrity Protection). This mechanism is introduced in OS X 10.11 and works to protect system-owned files and directories from unwanted modifications. If you try to edit the protected contents in the Terminal, the message "Operation not permitted" will show up.

How to fix Terminal error Operation not permitted

As we have known that the operation not permitted could be due to the Full Disk Access permission or System Integrity Protection, then we can proceed to fix this Terminal error with these aspects. You can follow the detailed guides below to remove the operation not permitted notification from the Terminal on your Mac computer.

Enable Full Disk Access to Terminal

  1. Click on the Apple logo and choose System Preferences.
  2. On the new window, find and open Security & Privacy.
  3. Choose the Privacy tab, then find Full Disk Access on the left sidebar.
  4. Click on the padlock in the left corner, and use Touch ID or password to unlock it.
  5. If the Terminal displays on the left pane but is checked, then check the box of it. Choose Quit & Reopen to grant Terminal with full disk access. 
  6. If not, click the + icon on the right pane, and find Terminal from Applications, click Open.  
  7. Then Terminal will list in the list of allowed apps with the box checked.
  8. Launch Terminal and enter the same command that triggers the operation not permitted error to see whether it works now.

enable Full Disk Access to Terminal

Disable System Integrity Protection Temporarily

Operation not permitted message still appears after enabling the Full Disk Permission to Terminal? Then, you can move to temporarily turn off System Integrity Protection on your Mac. It is necessary for developers to disable SIP to test code, debug apps, and install system extensions on Mac. After you perform the necessary tasks, you'd better reenable SIP as soon as possible to protect your Mac from virus attacks and malware infections.

  1. Shut down your Mac and reboot it into macOS Recovery mode.
  2. Click Utilities from the top menu bar and launch Terminal.
  3. Type the csrutil disable command in Terminal
  4. Press Return or Enter on the keyboard.
  5. Then click the Apple menu and choose Restart.
  6. Open the Terminal app and run the previous command.

disable SIP on Mac

Disabling System Integrity Protection leaves your Mac vulnerable. Therefore, after completing tasks in Terminal, you should reenable  System Integrity Protection, just repeat the above steps again and run the command csrutil enable instead in Terminal. 

The bottom line

When the Terminal says "Operation not permitted," it means you are not privileged to access the protected files and directories on your Mac. But you get two fixes in this post. After you enable the Full Disk Access permission to Terminal or disable SIP in Recovery mode, the error message will disappear and don't forget to reenable SIP after using Terminal.