Search
  • For Individuals
      « Back
    • Windows Data Recovery

      Recovers lost or deleted Office documents, emails, presentations & multimedia files.

      Free Standard Professional Premium

    • Mac Data Recovery

      Recovers deleted files, photos, videos etc. on Mac.

      Free Standard Professional Premium

    • Photo Recovery

      Recover photos, videos, & audio files from all cameras and storage on Windows or Mac.

      Free Standard Professional Premium

    • Video Repair
    • Photo Repair
    • iPhone Data Recovery
  • For Business
      « Back
    • Email Repair & Converter

      Repair for Exchange Converter for EDB Converter for OST Converter for NSF Converter for OST MBOX Repair for Outlook

    • Database & File Repair

      Repair for MS SQL Repair for Access Repair for QuickBooks Software Repair for Excel Extractor for Windows Backup Repair for MySQL

    • Data Recovery & Erasure

      Data Recovery Professional Data Recovery Technician Mac Recovery for Technician Virtual Machine Recovery File Erasure Software Mobile Erasure Drive Erasure File Eraser Software File Eraser Software for Mac

    • Toolkit

      Exchange Toolkit Outlook Toolkit File Repair Toolkit MS SQL Toolkit Data Recovery Toolkit

    • Forensic

      Email Forensic Exchange Auditor Log Analyzer for MySQL Log Analyzer for MS SQL

  • Store
  • Partners
  • Services
  • Offers
  • Support

 

  • For Individuals
    DIY software for anyone who works with data.

    Windows Data Recovery Recovers lost or deleted Office documents, emails, presentations & multimedia files

    Free Standard Professional Premium

    Mac Data Recovery Especially for Mac users to recover deleted documents and multimedia files from macOS

    Free Standard Professional Premium

    Video Repair Windows Mac Repair multiple corrupt videos in one go. Supports MP4, MOV & other formats.

    StandardPremium

    Photo Recovery Windows Mac Recover photos, videos, & audio files from all cameras and storage on Windows or Mac.

    Standard Professional Premium

    iPhone Data Recovery Windows Mac Recover deleted photos, videos, contacts, messages etc. directly from iPhone & iPad

    Recover Erase Toolkit

    Photo Repair Windows Mac Repair multiple corrupt photos in one go. Supports JPEG & other formats.

    Standard Professional Premium


  • For Business
    • Email Repair
    • Email Converter
    • File Repair
    • Data Recovery & Erasure
    • Toolkit
    • Forensic

    Exchange Repair Repair corrupt EDB file & export mailboxes to Live Exchange or Office 365

    Outlook PST Repair Repair corrupt PST & recover all mailbox items including deleted emails & contacts

    OLM Repair Repair Outlook for Mac (OLM) 2011 & 2016 backup files & recover all mailbox items

    Exchange Toolkit Repair EDB & Exchange backup file to restore mailboxes, convert OST to PST, & convert EDB to PST

    Active Directory Repair Repair corrupt Active Directory database (Ntds.dit file) & extract all objects in original form

    EDB to PST Convert online & offline EDB file & extract all mailbox items including Public Folders in PST

    OST to PST Convert inaccessible OST file & extract all mailbox items including deleted emails in PST

    NSF to PST Convert IBM Notes NSF file & export all mailbox items including emails & attachments to PST

    MBOX to PST Convert MBOX file of Thunderbird, Entourage & other clients, & export mailbox data to PST

    OLM to PST Convert Outlook for Mac Data File (OLM) & export all mailbox data to PST in original form

    GroupWise to PST Convert GroupWise mail & export all mailbox items - emails, attachments, etc. - to PST

    EML to PST Convert Windows Live Mail (EML) file & export mailbox data - emails, attachments, etc. - to PST

    Office 365 to PST Connect to Office 365 account & export mailbox data to PST and various other formats

    DBX to PST Convert Outlook Express (DBX) file & export all mailbox data - emails, attachments, etc. - to PST

    SQL Repair Repair corrupt .mdf & .ndf files and recover all database components in original form

    Access Repair Repair corrupt .ACCDB and .MDB files & recover all records & objects in a new database

    QuickBooks Repair Repair corrupt QuickBooks® data file & recover all file components in original form

    MySQL Repair Repair MyISAM & InnoDB tables and recover all objects - keys, views, tables, triggers, etc.

    Excel Repair Repair corrupt Excel (.XLS & .XLSX) files and recover tables, charts, chart sheet, etc.

    BKF Repair Repair corrupt backup (BKF, ZIP, VHDX and .FD) files and restore complete data

    Database Converter Interconvert MS SQL, MySQL, SQLite, and SQL Anywhere database files

    PowerPoint Repair Repair corrupt PPT files and restore tables, header, footer, & charts, etc. like new

    File Repair Toolkit Repair corrupt Excel, PowerPoint, Word & PDF files & restore data to original form

    Data Recovery Windows Mac Recover lost or deleted data from HDD, SSD, external USB drive, RAID & more.

    Technician Toolkit

    Tape Data Recovery Retrives data from all types and capacities of tape drives including LTO 1, LTO 2, LTO 3, & others.

    Virtual Machine Recovery Recover documents, multimedia files, and database files from any virtual machine

    File Erasure Permanently wipe files and folders, and erase traces of apps and Internet activity.

    Standard Corporate

    Mobile Erasure Certified and permanent data erasure software for iPhones, iPads, & Android devices

    Drive Erasure Certified and permanent data erasure software for HDD, SSD, & other storage media Windows Mac

    Exchange Toolkit 5-in-1 software toolkit to recover Exchange database, convert EDB to PST, convert OST to PST, restore Exchange backup, and reset Windows Server password.

    Outlook Toolkit Comprehensive software suite to repair PST files, merge PST files, eliminate duplicate emails, compact PST files, and recover lost or forgotten Outlook passwords.

    File Repair Toolkit Powerful file repair utility to fix corrupt Word, PowerPoint, and Excel documents created in Microsoft Office. It also repairs corrupt PDF files and recovers all objects.

    MS SQL Toolkit 5-in-1 software toolkit to repair corrupt SQL database, restore database from corrupt backup, reset database password, analyze SQL logs, & interconvert databases.

    Data Recovery Toolkit Software helps to recovers deleted data from Windows, Mac and Linux storage devices. Also supports recovery from RAIDs & Virtual Drives.

    Email Forensic Advanced email forensic solution for cyber experts to audit, analyze, or investigate emails & gather evidences.

    Exchange Auditor Exchange Server monitoring solution to automate audits, scans and generate reports ìn real-time.

    Log Analyzer for MySQL Analyze forensic details of MySQL server database log files such as Redo, General Query, and Binary Log.

    Log Analyzer for MS SQL Track & analyze MS SQL Server database transactions log files.

    Email Forensic
    STELLAR EMAIL FORENSIC

    Advanced email forensic tool to analyze and collect the mailbox data of email clients

    Learn More arrow


    All Products arrow

    All Products arrow

    All Products arrow

    All Products arrow

  • Our Partners
  • Lab Services
  • microphone-icon-android

    Trending Searches

    Data Recovery

    Photo Recovery

    Video Repair

    iPhone Data Recovery

    File Erasure Software

    Exchange Repair

    OST to PST

    PST Repair

    Raid Recovery

    MS SQL Repair

  • English Deutsch Français Nederlands Italiano Español 日本語 简体中文
  • Support
Learning with Stellar 5 minute read

[Fixed] Zsh Permission Denied in Mac Terminal

Published on June 29th, 2022
Ruslana Lishchuk
Written By
Ruslana Lishchuk

Summary: This post serves as a short and easy guide on the reasons why you are getting Zsh permission denied error that happens to appear in macOS Terminal and ways to fix it, as well as prevent the error from happening in the first place.

Contents

  • What does Zsh Stand for?
  • What is Zsh Permission Denied Error?
  • Ways to Fix the Zsh Permission Denied Error on Mac
    • A. Check Disk Permissions
    • B. Change the Ownership of the Directory to Solve Zsh Permission Denied
    • C. Grant Access to the Disk to Terminal if it has No Full Access
    • D. Use a Sudo Command 
  • Is There a Way to Prevent Terminal Permission Denied Errors on Mac?
    • Assign Permissions to Users and Groups
    • Grant Permissions to All Items in a Folder
    • Change the Owner of an Item 
    • Add or Remove a User or Group
  • It’s a Wrap

So, you are opening a file, and you have decided to do it with the help of the Terminal app. A moment later you see the Zsh permission denied error. How to fix that? Let us first take a look at the root of the problem itself.

What does Zsh Stand for?

The Zsh or the so-called Z shell is a Unix shell. It’s a macOS default shell designed on top of bash. In other words: it’s the default Shell in macOS (and a shell itself is the interface that provides access to an operating system’s services). Zsh is used more often than Bash (“bourne again shell”) since it is more powerful, and has an extended number of features.

What is Zsh Permission Denied Error?

The problem you are encountering appears when the Terminal cannot complete the task as it simply can’t access the file. Either the file is locked, the command has been formatted in a wrong way, or even the file permission is insufficient.

Ways to Fix the Zsh Permission Denied Error on Mac

A. Check Disk Permissions

Since we have talked about file permissions, let’s start with them. 

To check disk permissions through Terminal:

1. Open Terminal and paste the following command: ls -l. Add a space after the command and do not press Enter for now.

Terminal
Terminal

2. Find the file you need to open > drag it into the Terminal window (this will not actually move the item, but will do the trick).

3. Press Return.

If the letters “rwxr” appear before your username in the result string, it means you have the access to read, write, and execute the file. If there is only one sign, for example, “r”, it means the file is read-only to you.

If you are checking disk permissions of the file through Finder:

  1. Find the desired file in the Finder window.
  2. Press Command + I to open the Get Info option. Find Sharing & Permissions at the bottom of the window.
  3. In case you see nothing beneath it, find the arrow and click it.

The permissions should now be visible to you. To have the necessary access, it should state “Read & Write”.

Get Info window > Sharing & Permissions
Get Info window > Sharing & Permissions

B. Change the Ownership of the Directory to Solve Zsh Permission Denied

Let’s try changing the ownership of the directory:

Open Terminal again and use the command chown -R $USER:$USER /path/to/directory. 

Where $USER is the currently logged-in user and /path/to/directory – a place you are writing it to.

C. Grant Access to the Disk to Terminal if it has No Full Access

If it is the case with Terminal, this might be another reason for the Zsh permission denied error. 

To check if that’s true, and give them access to the disk, do the following:

  1. Open System Preferences. 
  2. Find Security & Privacy. 
  3. Then choose the Privacy tab.
  4. Click the padlock in the left bottom corner > type your admin password to apply changes.
  5. From the list choose Terminal and tap the mark beside it to add it to the list of full access.
Security & Privacy > Privacy tab > Full Disk Access highlighted
Security & Privacy > Privacy tab > Full Disk Access highlighted

Note: If Terminal is not on the list (this may happen in the newest macOS versions), you’ll need to add it manually by clicking the + button and searching Terminal in the search bar. Next, you’ll need to quit Terminal to apply the changes.

Add Terminal to Full Disk Access on Mac
Add Terminal to Full Disk Access on Mac

D. Use a Sudo Command 

If none of the above helped use the superpower — a Sudo command. In simple words, a Sudo command stands for superuser do, when a permitted user gains super user privileges or executes a command as another user. Mind it will ask for the current (not the root one) user’s password when using the mentioned command for the first time.

Here are the commands you might try:

  • sudo chmod 755 ~/Themes/ObsidianCode.xccolortheme
  • sudo chmod 755 /dvtcolorconvert.rb
Terminal on Mac > run a sudo command
Terminal on Mac > run a sudo command

Is There a Way to Prevent Terminal Permission Denied Errors on Mac?

Yes, there are actually four of them. Read on to find out more.

Assign Permissions to Users and Groups

Give permissions to a number of users and groups to prevent issues with permission. To do this:

  1. Choose a file, folder, or disk, then open File > Get Info.
  2. Tap on the lock sign to unlock the item. If it’s asking for your admin’s name and password — fill them in.
  3. From the Name column choose a user or group, this will open the popup menu > click the Privileged Setting option.
Get Info > Sharing & Permissions
Get Info > Sharing & Permissions

Here’s what each permission means:

  • Read Only: you can only access the item without changing it.
  • Write Only: a folder becomes a DropBox, where the user can copy an item and move it there without opening the file itself.
  • Read & Write: permission to do both viewing and editing the file. 

Grant Permissions to All Items in a Folder

Giving permissions to all items on a disk or in a certain folder means they will be accessed only by certain users:

  1. Select a directory (disk or folder) > then go to File in the menu bar.
  2. Click Get Info.
  3. Click on the padlock and type in your admin password. 
  4. Check the bottom of the window >choose to Apply to Enclosed Items.
  5. Click OK for the necessary changes to apply.

Change the Owner of an Item 

Issues with Zsh permission denied in Mac Terminal may also occur if the owner of an item is another user.

To change the owner of a file:

  1. Go to File of the chosen item > Get Info.
  2. Add the new owner with the Add (+) button, using the action pop-up menu. 
  3. Then click Make [the chosen owner] as the owner of an item.
  4. Save changes.

Add or Remove a User or Group

Adding or removing a user or group can also resolve permission issues. 

Here’s how to do so:

  1. Find the desired item.
  2. Go to File > tap Get Info.
  3. Look for Sharing & Permissions. 
  4. Hit Add (a + sign) a user or group if you would like to add one, or click Remove  (a – sign) a user or group to remove it.
  5. Click to apply changes.

It’s a Wrap

If you happen to decide to open a file not by double-clicking it, but by doing it with Terminal instead — probably there is a reason why you have decided to use the less conventional way. Issues with accessing items this way are not uncommon, and we hope our simple guidelines will help you fix the error in no time, and with little effort. Since it is basically a permission issue, the first thing you would need to do is to check all possible permissions or check if the user you are logged under has sufficient access. 

Read more: 

  • How to Recover from External Hard Drive Read-Only Error on Mac?
  • How to Recover Files from a Deleted Mac User Account?

About The Author

ruslana

Ruslana is a tech content writer whose true passion is finding out about everything Mac-related. She specializes in creating macOS guides and tips & tricks. In her spare time, you’ll find her doing yoga or discovering local coffee shops in search of the best filter coffee.

Best Selling Products

Stellar Data Recovery Professional for Windows

Stellar Data Recovery Professional for Windows

Stellar Data Recovery has the right Windows Recovery tool for all your data recovery

Read More
Stellar Data Recovery Professional for Mac

Stellar Data Recovery Professional for Mac

Stellar Data Recovery for Mac program performs safe..

 

Read More
Stellar Photo Recovery

Stellar Photo Recovery

A comprehensive photo recovery software to restore photos, music & video files

 

Read More
Stellar Repair for Video

Stellar Repair for Video

Powerful video repair tool for repairing corrupt or damaged MOV and other video files

 

Read More

Leave a comment Cancel reply

Your email address will not be published. Required fields are marked *

98  −    =  92

Table of Contents    arrow

  1. What does Zsh Stand for?
  2. What is Zsh Permission Denied Error?
  3. Ways to Fix the Zsh Permission Denied Error on Mac
    • A. Check Disk Permissions
    • B. Change the Ownership of the Directory to Solve Zsh Permission Denied
    • C. Grant Access to the Disk to Terminal if it has No Full Access
    • D. Use a Sudo Command 
  4. Is There a Way to Prevent Terminal Permission Denied Errors on Mac?
    • Assign Permissions to Users and Groups
    • Grant Permissions to All Items in a Folder
    • Change the Owner of an Item 
    • Add or Remove a User or Group
  5. It’s a Wrap

Categories

Related Posts

related post
Learning with Stellar

All the Ways to Troubleshoot “Volume Hash Mismatch” Error on macOS Monterey

Stellar Author Ruslana Lishchuk August 2, 2022 Read More
related post
Learning with Stellar

[Fixed] macOS Monterey Battery Drain

Stellar Author Ruslana Lishchuk July 27, 2022 Read More
related post
Learning with Stellar

6 Ways to Fix Kernel_Task High CPU Usage on Mac Issue

Stellar Author Ruslana Lishchuk July 22, 2022 Read More

Free Trial for 60 Days

Stellar Official Website

Stellar Data Recovery Inc.
48 Bridge Street Metuchen,
New Jersey 08840,
United States

ALSO AVAILABLE AT

Partner Logo

About

  • About us
  • Career
  • ISMS Policy
  • Privacy Policy
  • Terms of Use
  • License Policy
  • Refund Policy
  • End User License Agreement

RESOURCES

  • Blog
  • Articles
  • Product Videos
  • Knowledge Base
  • Case Studies
  • Whitepapers
  • Software Catalog

NEWS & EVENTS

  • News
  • Events

PARTNERS

  • Affiliates
  • Resellers
  • Distributors

Useful Links

  • Contact Us
  • Support
  • Special Offers
  • Student Discounts
  • Awards & Reviews
  • Downloads
  • Store
  • Sitemap
Follow Us

tw in yt

Stellar & Stellar Data Recovery are Registered Trademarks of Stellar Information Technology Pvt. Ltd. © Copyright 2022 Stellar Information Technology Pvt. Ltd. All Trademarks Acknowledged.

Hippa Logo tuv footer partner logo DMCA.com Protection Status
We use cookies on this website. By using this site, you agree that we may store and access cookies on your device Read More Got it!