Pcornel
Browse topics
Options
Recent
Favorites
Linux · Technical reference

Permission Denied

Direct 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.

When to use this

Use it when a user or service gets Permission denied.

First 30 seconds

1. Which user? ps -o user= -p <pid> or the service's User=.

2. namei -l <path> — x on every directory?

3. ls -l / getfacl — mode and ACL.

4. Mount: findmnt -no OPTIONS <mount> (ro, noexec).

5. SELinux ausearch -m avc -ts recent / AppArmor journalctl -k | grep DENIED.

Operational verification

process with UID/GID → path walk (x on directories) → mode/ACL → mount options → SELinux/AppArmor → allowed

Evidence · next step

For Linux Troubleshooting → Permission Denied, continue with the first unproven Topic check: Capture exact failing syscall/path, process UID/GID/groups and namespace/context. If that boundary is healthy, advance to the adjacent check: Walk path-component execute permissions plus target owner/group/mode and ACL mask. Preserve the same host/time/identity scope and rerun the original workload before accepting recovery.

Continue only after interpreting the current observation.
Context & applicabilityCommon mistakes · platform/version boundaries
Platform / version applicability
linux
applies
Structured applicability is explicit Topic metadata; it does not infer compatibility beyond the stored rows.
At a glance

Operational reference

Fast context before you go deeper.

Platformlinux
Scope / prerequisiteUse it when a user or service gets Permission denied.
What next?3 suggested next steps
Evidence1
On this pageJump to a specific section
Operational workflow

Verification & Troubleshooting

Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.

5 steps Observe → verify → isolate → change minimally → repeat the original test.
ObservedRecord what the original test actually shows

Capture the concrete output, symptom, packet, log or counter before changing anything.

Step 1 Operational evidence path Verify boundary

Healthy evidence: the exact process identity receives the intended kernel access decision after a minimal policy/ownership correction, with no unnecessary privilege expansion and the original operation succeeding.

Step 2 Verification and output interpretation Verify boundary

Existing fast checks for this Topic. - Capture exact failing syscall/path, process UID/GID/groups and namespace/context.

  • Walk path-component execute permissions plus target owner/group/mode and ACL mask.
  • Check mount flags, SELinux/AppArmor labels/denials and systemd/container sandbox controls.
  • Apply the narrowest policy/ownership fix and repeat the same operation as the original identity.
Step 3 Commands Verify boundary
ls -l file ; namei -l /path/to/file
id user
getfacl file
ausearch -m AVC -ts recent
Step 4 Failure modes and next checks Narrow the fault

Suspicious evidence: 777 is used as diagnosis, root success is considered evidence, only final file mode is inspected, or ACL mask/parent traversal/LSM/service sandboxing is skipped.

Step 5 Common mistakes Narrow the fault
  • Fixing with 777 instead of finding the missing permission or SELinux label.
Evidence references

Evidence · 1 on this Topic

Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.

observation · 1
Key points

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.

Key checks
  • journalctl -b -p err — errors this boot
  • systemctl --failed — failed units
  • df -h; df -i — space and inodes
  • ss -tulpn — listening sockets
  • dmesg -T | tail — recent kernel messages
ReferenceWhat it is1 section · depth on demand

Core model

Evaluate access as the kernel does for the exact process and object. Resolve UID/GID and supplementary groups, every directory component, ACL/mode, mount and LSM policy, plus systemd/container restrictions; do not fix by broad chmod.

ReferenceImportant terms & boundaries4 sections · depth on demand

What this shows and what it does not

Permission Denied owns cross-layer access fault isolation; Users & Permissions and Linux Security own detailed DAC/ACL/LSM policy semantics.

In depth

Every directory on the path needs search (x) permission

The path_resolution manual states that if the process lacks search permission on a directory during lookup, the lookup fails with EACCES; for directories the execute bit means search. That is why a file with rw-r--r-- can still be unreadable:

$ namei -l /srv/app/data/config.yml
f: /srv/app/data/config.yml
drwxr-xr-x root root   /
drwxr-xr-x root root   srv
drwxr-x--- root appadm app
drwxr-xr-x app  app    data
-rw-r--r-- app  app    config.yml

/srv/app has no x for others, so a user outside group appadm cannot reach config.yml despite its permissions.

Layers to check, in order

LayerCommandTypical surprise
Identityid <user>; for services systemctl show <unit> -p User -p Group -p SupplementaryGroupsService runs as another user; new group membership needs a new login
Classic permissions on the whole pathnamei -l <path>Missing x on a parent
ACLsgetfacl <path>Mask entry limits ACL rights
Attributeslsattr <file>i (immutable), a (append-only) — even root cannot write
Mount optionsfindmnt -T <path>ro, noexec, nosuid, nodev
MACausearch -m AVC -ts recent (SELinux) / journalctl -k \| grep DENIED (AppArmor)Permissions fine, policy denies
systemd sandboxingsystemctl show <unit> -p ProtectSystem -p ProtectHome -p ReadWritePathsUnit sees /home empty or /usr read-only
Capabilitiesgetpcap <pid>Binding to ports < 1024 without CAP_NET_BIND_SERVICE

Reproduce as the right user

sudo -u www-data test -r /srv/app/data/config.yml && echo readable
sudo -u www-data ls /srv/app/data/

Testing as root proves nothing — root bypasses classic permissions (but not MAC, immutable bits or read-only mounts).

noexec and scripts

Permission denied when running ./script.sh on a noexec mount (often /tmp) persists even with chmod +x; bash script.sh works because the shell reads the file — move the script instead of removing noexec.

*The namei listing uses a fictional directory tree to demonstrate traversal permissions, rather than an exported access report.*

Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.

How it works at runtime

Permission Denied is part of Linux Troubleshooting → Permission Denied. Permission Denied isolates Linux access failures across process credentials, path traversal, owner/group mode bits, ACLs, sudo transitions, mount options, SELinux/AppArmor and service sandboxing.

Topic-specific state model. Permission Denied isolates Linux access failures across process credentials, path traversal, owner/group mode bits, ACLs, sudo transitions, mount options, SELinux/AppArmor and service sandboxing.

Interpretation rule. - File mode alone ≠ effective access decision.

  • Membership in a group ≠ current process/session has that supplementary group.
  • sudo works ≠ the service or application identity has access.
  • chmod 777 removes a symptom ≠ ownership, ACL, LSM or path policy is correct.

Method

"Permission denied" has several possible layers — check in order:

1. Mode bits and ownership on the file and every parent directory (x needed to traverse): namei -l /srv/app/data/file.

2. ACLs: getfacl.

3. Mount options: noexec, ro, nosuid (findmnt -T /path).

4. SELinux/AppArmor: ausearch -m AVC -ts recent, journalctl -k | grep DENIED.

5. Capabilities (binding ports < 1024 needs CAP_NET_BIND_SERVICE).

6. systemd sandboxing: ProtectHome, ProtectSystem, ReadWritePaths.

7. Immutable attribute: lsattr (i flag).

8. NFS root squash / ID mapping on network filesystems.

sudo -u appuser test -r /srv/app/data/file && echo readable
Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.
ReferenceConfiguration & state1 section · depth on demand

Configuration, persistence and lifecycle

Distribution/platform context. Permission Denied owns cross-layer access fault isolation; Users & Permissions and Linux Security own detailed DAC/ACL/LSM policy semantics.

Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Technical verification history

Verification history & basis

When and against what this Topic was checked. Later text edits do not count as a new check.

2026-09-14 · vendor doclinux current

Authoritative/upstream documentation reviewed for bounded claims in Linux Troubleshooting → Permission Denied. Documentation verification only; this is not observed lab or production Evidence.

Basis: https://docs.kernel.org/ · confidence 94%
Technical changelog & impact

What changed and what may be affected

Recent technical edits are separated from ordinary page timestamps. Relationship impact is advisory: it identifies nearby canonical references to review, not automatic breakage.

Terminology layer

Terms & aliases

Hover a linked term for a quick definition; click it to open its glossary entry. Aliases are other names that find this Topic in search.

Aliases that resolve here
linux permission deniedlinux access deniedchmod permission issueselinux permission denied
Embedded reference data

Quick lookup tables

Permission Denied operational reference

Topic-specific lookup boundaries, proof limits and next-step Evidence for Permission Denied.

Lookup boundaryTopic-specific referenceOperational use
Scope / effective statePermission Denied isolates Linux access failures across process credentials, path traversal, owner/group mode bits, ACLs, sudo transitions, mount options, SELinux/AppArmor and service sandboxing.Establish exactly what this Topic owns before crossing into another subsystem.
Fast verificationPin symptom + exact time + host/boot/user → define scope + expected baseline → preserve original failing test → collect targeted kernel/process/service/storage/network/security/log evidence → identify first divergent boundary → make one minimal reversible change → repeat original test → verify adjacent regressions and retain before/after evidence.Use the shortest evidence path first; a fast check is a boundary test, not blanket proof.
Verification chainsymptom + exact time → scope + baseline → reproduce original failure → collect first-party evidence → identify first failed boundary → minimal controlled change → repeat original test → regression/posture checkTrace requested/configured state through effective state to the observed workload result.
Failure boundaryPermission Denied troubleshooting is complete only when evidence localizes the first failed Linux boundary and the original failing workload passes after the smallest justified change; intermediate command success is not final proof.Stop broad troubleshooting at the first boundary that is not supported by evidence.
Positive evidenceCorrelated Linux troubleshooting evidence can establish this proof path: symptom + exact time → scope + baseline → reproduce original failure → collect first-party evidence → identify first failed boundary → minimal controlled change → repeat original test → regression/posture checkUse this observation only for the specific claim it actually supports.
Evidence limitIt does not independently prove behavior outside the captured host, boot, process/user, dependency, time or workload scope. Permission Denied troubleshooting is complete only when evidence localizes the first failed Linux boundary and the original failing workload passes after the smallest justified change; intermediate command success is not final proof.Do not promote a local success signal into end-to-end or adjacent-dependency proof.
Next troubleshooting checkContinue from the first unproven boundary: reproduce the exact original failure, collect the owning subsystem evidence at the same time, change only the proven cause or prerequisite, then repeat the original workload and regression checks.Continue to the next unresolved boundary while preserving the original test condition.

Permission Denied · operational reference

Compact Linux state, persistence, verification and boundary reference for fast lookup.

Reference boundaryPermission Denied
Topic pathLinux Troubleshooting → Permission Denied
Runtime statePermission Denied isolates Linux access failures across process credentials, path traversal, owner/group mode bits, ACLs, sudo transitions, mount options, SELinux/AppArmor and service sandboxing.
Fast checks- Capture exact failing syscall/path, process UID/GID/groups and namespace/context. - Walk path-component execute permissions plus target owner/group/mode and ACL mask. - Check mount flags, SELinux/AppArmor labels/denials and systemd/container sandbox controls. - Apply the narrowest policy/ownership fix and repeat the same operation as the original identity.
Verification chainsymptom + exact time → scope + baseline → reproduce original failure → collect first-party evidence → identify first failed boundary → minimal controlled change → repeat original test → regression/posture check Boundary chain: local authoritative state → adjacent dependency → effective/programmed state → original workload/request → return/regression → explicit Evidence boundary. Boundary chain: local authoritative state → adjacent dependency → effective/programmed state → original workload/request → return path or regression → explicit Evidence boundary.
Failure boundaryPermission Denied troubleshooting is complete only when evidence localizes the first failed Linux boundary and the original failing workload passes after the smallest justified change; intermediate command success is not final proof. Boundary chain: process credentials/namespace → path/mount lookup → DAC/ACL/LSM → filesystem metadata → block/device/backend → completion/read-back.
Persistence ruleProve which configuration source owns the state, then prove that the running consumer loaded or generated the intended state.
Confirmation

Confirm action

Continue?