Fix “Permission Denied” in Linux

Quick explanation and fixes for the common Linux “Permission denied” error when running commands or accessing files.

By Rageypeep · Created 2026-03-04 11:33 UTC · Updated 2026-03-04 11:36 UTC

  • linux
  • permissions
  • terminal
  • troubleshooting
  • sysadmin

Fix "Permission Denied" in Linux

What it means

The "Permission denied" error happens when your user account does not have the required rights to access a file or run a command.

Common Causes

  • File is owned by another user
  • File is not executable
  • Directory permissions block access

Fix 1 — Run with sudo

If the command requires administrator privileges:

sudo command_here

Example:

sudo apt update

Fix 2 — Make a file executable

If you are trying to run a script:

chmod +x script.sh

Then run it with:

./script.sh

Fix 3 — Check permissions

View file permissions with:

ls -l

Example output:

-rwxr-xr-x 1 user user file.sh

Fix 4 — Change ownership

If needed you can change ownership:

sudo chown user:user filename

Notes

  • Be careful when using sudo.
  • Incorrect permissions can break system files.

Score: 0

Comments

Loading comments...

View-only mode. Editing requires your private owner token.