How to fix "Permission denied" on Linux

Diagnose and fix Permission denied errors: read the permission bits, correct ownership with chown, set the right mode with chmod, and know when sudo is the wrong answer.

Intermediate · about 7 min · Linux, macOS, WSL

"Permission denied" almost never means you need 777. It means the user running the command lacks read, write or execute on that path — or on a directory above it. Diagnose in that order and the fix is usually one command.

What this guide covers

Common pitfalls covered

Questions answered

This is a limited preview. The full walkthrough, command syntax and copy-ready examples are available to signed-in users.

Sign in to read the full page