Fill the Server: 80% off your first 4 monthly invoices, monthly billing. Ends Nov 30, 2026. 25 spots in this batch.FILL25
Fill the Server, annual: about 29.63% off your first annual invoice. Ends Nov 30, 2026.FILL25Y
Fill the Server, 2 year term: about 15.69% off your first biennial invoice. Ends Nov 30, 2026.FILL25B
Fill the Server, 3 year term: about 11.11% off your first triennial invoice. Ends Nov 30, 2026.FILL25T
80% off your first 3 months, monthly billing. Ends Dec 25, 2027.3MONTHS80
50% off your first annual Shared term. Ends Dec 31, 2027.50SHARED
Shared Starter, 3 year term: C$105.84 total.MOOSE294
20% off your first 3 monthly VPS invoices. Ends Dec 31, 2027.20VPS3
25% off your first annual base VPS term.25VPS

← All guides

VPS & Linux

Linux file permissions: ownership, modes, groups and ACLs explained

Published August 2026 · 2 min read · Updated 2026-09-09

Linux file permissions answer three questions: who owns the object, which group applies, and what read/write/execute operations are allowed. Troubleshooting is easier when you follow the process identity and each path component. Repeated chmod changes can hide the real permission problem.

Identify the process user and group

A web server, application, cron job, deployment agent, and interactive shell may run as different users. Check the actual service identity before changing ownership.

For a directory path, execute permission on every parent controls traversal even when the final file itself appears readable.

Use namei -l to inspect every path component

Run the read-only command below with the path that is failing. namei -l prints the root and each path component on its own line with the file type and mode, owner, and group, so you can read from the top of the path downward and find the first directory the service identity cannot traverse.

For a directory, execute permission means search or traversal permission. A final file can appear readable while the process still gets Permission denied because an earlier parent directory lacks execute permission for that identity. If the ordinary mode, owner, and group all look correct, inspect ACLs with getfacl before changing permissions.

namei -l /srv/www/example/public/index.php

Distinguish ownership from mode bits

chown changes owner/group; chmod changes permission bits. ACLs, setgid directories, umask, and security modules can add rules beyond the basic rwx display. Use getfacl when the ordinary mode, owner, and group do not explain the result.

Do not solve a write error by making an application tree world-writable.

Design shared-write paths deliberately

Uploads, cache, logs, sockets, deployments, and shared team directories may need write access, while application code should often stay read-only to the runtime. Separate those paths so the permission model reflects actual jobs.

For deployment workflows, use group ownership or ACLs so the web server and administrator do not need to keep taking ownership from each other.

Test from the service context

Run a safe read/write check as the service user or through the real application path. Confirm new files inherit the intended group and mode after the fix, not only the file you manually edited.

  • Find the real service identity.
  • Check every parent directory.
  • Keep code and writable state separate.
  • Verify inheritance for new files.

Next step

Understand Unix ownership and rwx modes, then use groups and ACLs where needed so services can access files without opening them to every user.

Explore DotMoose VPS hosting

Keep reading

Related guides.

HTTP 500, 502 and 503 errors explained for website owners

Learn what HTTP 500, 502 and 503 errors usually indicate, which layer to investigate, what evidence to collect, and when restarting a service is not the real fix.

Read the guide

Moving a DreamHost VPS to Canadian hosting

Inventory the server, copy it safely, test it, and cut DNS over with a rollback plan.

Read the guide

VPS CPU steal: how to check it and investigate a slow server

Check VPS CPU steal with vmstat, distinguish host CPU waits from your own workload, and collect useful evidence before changing plans.

Read the guide

More vps & linux guides

We will handle the move. You check it first.

Your current site stays online until your new one is ready. You approve the copy first, and if anything is not right we switch you back right away. The price you pick is the price you renew at.

Start my free moveSee plans and prices
See pricesFree move