MacBook Air M4: zsh: permission denied and no common troubleshooting works

Hi! I have a question regarding the terminal.


I am trying to access any directory/file from terminal but I keep getting the zsh: permission denied message. I am on a macbook air M4, it is 5 months old and I haven't tweaked anything on the settings to make this happen.


Already tried the normal troubleshooting steps:

  • permission on settings
  • chmod +x/755
  • permissions on files
  • sudo - works but then asks for a password and it doesn't seem to be the one I use to log in so idk

it happens for basically all files.

Could anyone help me out? I can't think of another thing to try Thanks!!



Posted on Jan 29, 2026 3:14 AM

Reply
8 replies

Jan 29, 2026 5:44 AM in response to troubleshooting_banana

I don't have a definitive answer, I'm afraid. Some stuff to try that might help others to help.


It sounds to me as if Terminal either hasn't got access to the files or you are signed on as a different user.


Open System Settings, search for "Disk Access" and select "Allow applications to access all user files". In the RH pane make sure that Terminal has full disk access.


In Terminal make sure which ID is using Terminal with the command


id -un


It should be the same ID as the owner of the files you're trying to use.

Jan 29, 2026 6:10 AM in response to troubleshooting_banana

Have you tried booting in recovery mode and trying access them via Terminal? It's worth a go.


The fact that your password doesn't work with sudo implies that either your account hasn't got admin rights or there's another account or that Root access is required to do what you want to do. Have you confirmed that your account has got admin rights? If it has then you can make sure you are logged in to Terminal as admin with


su <user name>


I can't remember how to enable the root account or if it's even possible these days. I do remember that it's not recommended to leave root access open, but it might help., It'll be quicker for you to google it than for me to do so and write it up.



Jan 29, 2026 9:22 AM in response to troubleshooting_banana

Exactly what type of file is this "TreeTagger" file?


From what you've shown in the screenshot, it appears you are trying to execute the TreeTagger file. If the file is not a script or binary executable compatible with macOS, then your command will not work.


As for the "sudo" password, your macOS user account must be an admin user account and not a standard user account unless an exception has been made to elevate that user's permissions/abilities.

MacBook Air M4: zsh: permission denied and no common troubleshooting works

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.