Site icon New Generation Enterprise Linux

Stop losing your mind when files keep ignoring your umask

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

Stop losing your mind when files keep ignoring your umask

🧩 The Challenge

You set the umask to 002 for your project directory, but then some developer creates a file and it still ends up with 644 permissions. It makes zero sense until you realize the sticky bit or default ACLs are playing tricks on you behind your back.

💡 The Fix

Use the default ACL settings for the directory instead of fighting the global umask. This forces every new file to inherit the permissions you actually want, regardless of the user’s local shell settings.

setfacl -d -m u::rw,g::rw,o::r /your/project/dir

⚙️ Why It Works

Setting the default ACL on a directory ensures that any new child object automatically gets those permissions applied upon creation. It overrides the umask entirely, which is a massive relief when you have multiple devs touching the same repo.

🚀 Pro-Tip: Run getfacl on a directory first to see if a legacy default ACL is already causing your headache.

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

0 0 votes
Article Rating
Exit mobile version