Other EACCESMedium

Permission Denied Error: Causes and Fixes

The article explains what causes the 'Permission Denied' error and provides step-by-step solutions for different operating systems. You will learn how to restore access to files and folders.

Updated at February 16, 2026
5-15 min
Easy
FixPedia Team
Применимо к:Windows 10Windows 11Ubuntu 20.04+macOS Monterey+Android 10+

What Does the "Permission Denied" Error Mean

The Permission Denied error (literally "permission rejected") is a system message that appears when an operating system or application blocks access to a file, folder, registry, or other resource due to insufficient privileges for the current user. The error text may vary depending on the platform:

  • On Windows: Access is denied, Error 5: Access is denied.
  • On Linux/macOS: Permission denied.
  • In web servers (e.g., Apache): (13)Permission denied: access to ... denied.

It typically occurs when attempting to:

  • Run a program that requires administrator/superuser privileges.
  • Read from or write to system directories (e.g., C:\Windows\System32 or /etc).
  • Access a file owned by another user.
  • Execute a command in a terminal without sudo (Linux/macOS).

Common Causes

  1. Running Without Administrator/Superuser Privileges
    Many system utilities or installers require elevated privileges. If launched from a standard user account, the system will block access.
  2. File or Folder Owned by Another User
    For example, a file created under the root account (Linux) or SYSTEM (Windows), where the current user has no access rights.
  3. File Locked by Another Program
    If a file is open in another application (e.g., a text editor), the system may prevent its modification.
  4. Antivirus or Firewall Blocking Access
    Security software may mistakenly flag legitimate actions as threats and deny resource access.
  5. Corrupted Access Control Metadata (ACL)
    On Windows (Access Control Lists) or Linux (file attributes), permissions may be misconfigured, causing the error even for administrators.
  6. Attempting to Write to a System or Protected Folder
    For instance, trying to save a file directly into C:\Program Files without administrator rights.

Solutions

Solution 1: Change File or Folder Permissions

Use this method when the error relates to a specific file or directory. You will grant the current user the necessary permissions.

On Windows:

  1. Right-click the file/folder → Properties.
  2. Go to the Security tab.
  3. Click Edit (or Advanced for advanced settings).
  4. Select your user account from the list and check the required permissions (e.g., Full control or Write).
  5. Click Apply and OK.
# Alternatively, via PowerShell (run as Administrator):
# Grant full access to the current user on file C:\example\file.txt
$acl = Get-Acl C:\example\file.txt
$rule = New-Object System.Security.AccessControl.FileSystemAccessRule("$env:USERNAME","FullControl","Allow")
$acl.SetAccessRule($rule)
Set-Acl -Path C:\example\file.txt -AclObject $acl

On Linux/macOS:

  1. Open a terminal.
  2. Check current permissions: ls -l /path/to/file.
  3. Change owner (if needed): sudo chown $USER /path/to/file.
  4. Change permissions: chmod 755 /path/to/file (755 — read/write for owner, read for others).
# Example: grant write permissions to group and owner
chmod u+rwx,g+rwx,o-rwx /home/user/file.txt
# Or numeric mode: 770 (all permissions for owner and group)
chmod 770 /home/user/file.txt

Solution 2: Run the Program with Elevated Privileges

If the error occurs when launching an executable or command, try running it as an administrator (Windows) or with sudo (Linux/macOS).

On Windows:

  • Right-click the program → Run as administrator.
  • Or in a command prompt (run as administrator), enter the program's path.

On Linux/macOS:

Prefix the command with sudo. For example:

sudo apt update
sudo nano /etc/hosts

You will be prompted for the administrator password.

⚠️ Important: Do not use sudo for all commands indiscriminately. This can compromise system security.

Solution 3: Temporarily Disable Antivirus and Firewall

Sometimes security software (especially third-party antiviruses) incorrectly blocks access to files that are actually safe.

  1. Open your antivirus control panel.
  2. Find real-time protection or access protection settings.
  3. Temporarily disable protection (usually for 5–10 minutes).
  4. Repeat the action that triggered the error.
  5. If the error disappears, add the folder/program to your antivirus's exclusions list and re-enable protection.

💡 Tip: On Windows, also check Windows Defender Firewall—it can sometimes block access to network resources.

Solution 4: Restore Permissions via Command Line (Advanced)

If standard methods fail, Access Control Lists (ACL) may be corrupted. Restore them via the command line.

On Windows (use icacls):

# Run PowerShell or cmd as Administrator.
# Reset ACL to inherit from parent folder
icacls "C:\problem\folder" /reset /T /C
# /T — recursively for all subfiles, /C — continue on errors.

On Linux/macOS (use setfacl):

# Remove extended ACLs (retain standard permissions)
setfacl -b /path/to/file
# Or explicitly set permissions for a user
setfacl -m u:username:rwx /path/to/file

Solution 5: Scan for Malware

Some viruses or rootkits modify access permissions to system files to prevent their deletion or analysis.

  1. Run a full system scan with your antivirus.
  2. Use specialized tools like Malwarebytes or ESET Online Scanner.
  3. If malware is found, follow your antivirus's recommendations for removal and system file recovery.

Prevention

To minimize the risk of Permission Denied errors, follow these practices:

  • Avoid running programs from system folders (e.g., C:\Windows\System32 or /usr/bin) unless necessary. If required, use Run as administrator or sudo.
  • Configure permissions correctly when creating shared folders. On Windows: folder properties → SecurityEdit → add groups with needed permissions. On Linux: use chmod and chown immediately after creation.
  • Avoid working in system directories. Save personal files in Documents, Downloads, or /home/username.
  • Keep your operating system updated. Updates often fix bugs related to access permissions.
  • Use standard installation paths for programs. Do not change the install directory to a system location unless required.
  • On Linux/macOS: create a separate user without sudo rights for daily tasks, and switch to root only when necessary for administration.

If the problem recurs with a specific application, check its documentation—it may require special configuration or a specific runtime mode.

F.A.Q.

What does the 'Permission Denied' error mean?
Why does Permission Denied occur on Linux?
Can Permission Denied be prevented?

Hints

Identify the source of the error
Check current access permissions
Change access permissions
Run the program with elevated privileges
Temporarily disable antivirus and firewall

Did this article help you solve the problem?

FixPedia

Free encyclopedia for fixing errors. Step-by-step guides for Windows, Linux, macOS and more.

© 2026 FixPedia. All materials are available for free.

Made with for the community