Quit guessing why your web server is getting 403s on valid files

Permissions & Security (Chmod/Chown/ACLs/SELinux/AppArmor)

Quit guessing why your web server is getting 403s on valid files

🧩 The Challenge

Ever spent an hour chmodding everything to 777 because your application refuses to read a file, only to realize the parent directory doesn’t have the execute bit set? I’ve been there, and it’s embarrassing when the file is right there but the kernel just blocks you at the door.

💡 The Fix

Stop reaching for the nuclear chmod option and check the directory tree’s search permissions instead. You need the execute bit on every parent directory in the path for things to actually function.

namei -l /path/to/your/stuck/file

⚙️ Why It Works

Running namei lets you peel back the layers of the path to see exactly which directory in the chain is missing the execute permission that allows users to traverse into it. It maps out the entire tree so you aren’t hunting for that one directory buried in the hierarchy that’s causing the permission denied error.

🚀 Pro-Tip: If you’re on a system with complex nested paths, just pipe that output into a pager so you don’t lose your mind scrolling through long symlink chains.

Linux Tips & Tricks | © ngelinux.com | 9/12/2026

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Newest
Oldest Most Voted