Error Reference › Linux / Server
Linux / Server
Permission denied
The user/process doesn't have permission to read, write, or execute that file or resource.
What it looks like
bash: ./deploy.sh: Permission denied
Error: EACCES: permission denied, open '/var/log/app.log'
What does "Permission denied" mean?
Reported by the shell, the operating system or a program (Node shows EACCES, Python PermissionError) when the user running it lacks the right to read, write or execute a file, or to use a resource such as a low port.
What causes "Permission denied"?
- File owned by another user, or wrong mode bits.
- Trying to bind a privileged port (<1024) as non-root.
- A directory in the path isn't accessible.
How do I confirm the cause?
- Check who owns the file and its mode bits with ls -l, and which user is running the process with whoami or ps.
- For scripts, check the execute bit (chmod +x script.sh) and that the filesystem is not mounted noexec.
- Check every directory on the path: you need execute permission on each folder to reach a file inside it.
How do I fix "Permission denied"?
- Check ownership/permissions (ls -l) and fix with chown/chmod.
- Run with the right user (avoid blanket sudo).
- For ports <1024 use a reverse proxy or grant CAP_NET_BIND_SERVICE.
How do I stop it happening again?
- Run services as a dedicated user that owns only the files it needs.
- Avoid running things with sudo just to get past this error — it tends to leave root-owned files behind that cause the next one.