Permission Denied
Cheat sheet · https://pcornel.dk/topic.php?topic=2917
Answer
"Permission denied" (EACCES/EPERM) means the kernel refused an operation: file mode, ownership, ACL, a missing execute bit on a directory, a read-only or noexec mount, SELinux/AppArmor, or capabilities.
Remember
Check as the actual user, along the whole path. If mode bits look right, check ACLs, mount options and the MAC framework (SELinux/AppArmor) logs.
First checks
journalctl -b -p err— errors this bootsystemctl --failed— failed unitsdf -h; df -i— space and inodesss -tulpn— listening socketsdmesg -T | tail— recent kernel messages
Commands
id <user>systemctl show <unit> -p User -p Group -p SupplementaryGroupsfindmnt -T <path>systemctl show <unit> -p ProtectSystem -p ProtectHome -p ReadWritePathsfindmnt -T /path
Verify in this order
process with UID/GID → path walk (x on directories) → mode/ACL → mount options → SELinux/AppArmor → allowed
Where it usually breaks
First mismatch in persistent intent → provider/parser/generator → kernel/userspace runtime → dependency/security context → logs/counters → consumer-visible read-back; preserve identity/native diagnostic/pre-state before mutation.
Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=2917