Stop chasing your tail when permissions look fine but files are still locked

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

Stop chasing your tail when permissions look fine but files are still locked

🧩 The Challenge

Ever stared at a directory where the user and group match perfectly, yet you still get a Permission Denied error? It drives me crazy when chmod just doesn’t explain why a service can’t write to its own log folder.

💡 The Fix

Use lsattr to check for immutable or append-only flags that the standard tools hide from your view. These bits sit silently below the surface and will block root just as easily as a normal user.

lsattr -d /path/to/directory
chattr -i /path/to/directory

⚙️ Why It Works

Filesystems like ext4 have extra attributes that chmod or chown simply can’t modify. Running this command reveals if a file is marked immutable, which effectively makes it read-only for every user on the system until that flag is flipped.

🚀 Pro-Tip: Always check these flags if you are struggling with a persistent EPERM error on a file that otherwise looks like it should be writable.

Linux Tips & Tricks | © ngelinux.com | 8/18/2026

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Newest
Oldest Most Voted