Back to commands

Linux Survival Basics

Read-only

Trace Nginx Web Path Permissions

Nginx can see the file path only if each parent directory allows traversal.

Command

namei -l /srv/www/site/index.html

Before you run this

System impact: Read-only. Low when scoped to the shown target.

When not to use it: Do not chmod recursively from this output; identify the specific blocking component.

Expected output

Each path component with owner, group, and mode bits.

System impact

Read-only. Nothing changes. The command reads current state and prints diagnostic evidence.

Recovery / rollback: no state is changed.

When to use it

Use when Nginx returns 403 for a file that exists.

When not to use it

Do not chmod recursively from this output; identify the specific blocking component.

Example run

Commands shown

These are the commands shown for inspection. Treat them as an example, not proof that your system will behave identically.

  1. namei -l /srv/www/site/index.html
  2. namei -l /srv/www/site/index.html

next steps

Related commands

Linux Survival Basics Read-only

Check Web File Owner and Mode

The file can exist and still be unreadable to Nginx.

stat -c '%A %U:%G %n' /srv/www/site/index.html
Linux Survival Basics Read-only

Check Owner and Mode in One Line

The file existed. The owner and mode explained why it still failed.

stat -c '%A %U:%G %n' /var/www/example/index.html
Hosting Operations Can be slow

Audit a Symlink Permission Chain

A symlink can make the path you audited different from the file the app opens.

find /srv/www/example -type l -printf '%p -> %l\n' -exec namei -l {} \; 2>/dev/null

next diagnostic step

Where to go from this command

Study mapping

Use this as independent command practice: read the notes, predict the output, then compare it with the example before using a real shell.

  • LPIC-1 style command-line practice
  • LFCS style performance-task practice
  • Linux+ style troubleshooting review

Independent study support only. No affiliation, endorsement, exam dumps, or real exam questions.