Field guide to command line failures · reference only, nothing hosted here
CliHelper

Exit code 13, and the variants that look like it.

permission denied

What the message actually says

Permission denied is exit code 13. The kernel refused the call, and the message names the path, not the policy that refused it.

Check whether it is the file or the directory

namei -l /srv/data/file.db

Every directory on the path needs execute permission. A readable file inside an unsearchable directory still gives EACCES.

Read bits are not enough

Creating or replacing a file needs write permission on the directory itself, not on the file. Renaming and deleting both work on directory permission.

When sudo changes the answer

If the operation works as root, the policy is a permission. If it still fails, it is a mount option, an immutable attribute, or SELinux.

A file owned by you with mode 400 cannot be deleted by you if its parent directory lacks write permission. The error points at the file, the cause is above it.

Scope: failure mode: Exit code 13, and the variants that look like it.

CliHelper documents failure modes of third-party command line tools. No software is stored or distributed here.

Terms Privacy Contact support@clihelper.pro