Control default file permissions per user to protect data and workflows. 16.11.2025 | reading time: 2 min Who creates files on a multiuser system should control their default permissions; a user-specific umask lets a user decide how open new files and directories start out, reducing accidental exposure and fitting personal workflows. Quick hands-on demo Try this in a shell to see the effect immediately: ```$ umask 027; touch secret.txt; stat -c "%A" secret.txt # => -rw-r-----``` which shows that with umask 027 a new file gets permissions 640, and a new directory would get 750, so set the mask you want and then create files to verify. Where to make it stick Persist a per-user umask by adding a single line like `umask 027` to the user's login files (for a login shell use `~/.profile` or `~/.bash_profile`, for interactive shells `~/.bashrc` or the shell's equivalent), and for services use a systemd unit with UMask= or enable pam_umask for centralized control. Pitfalls and fine-tuning Remember umask subtracts from the process default modes (files 666, directories 777), so setting 000 makes everything wide open and 077 makes it private; executable bits are not granted by umask for regular files, ACLs and setgid bits may override expectations, and global files like /etc/login.defs or /etc/profile can shadow per-user settings. Complementary commands to know After tuning a umask, use `chmod` to fix existing files, `getfacl`/`setfacl` for richer access control, and inspect login configuration or systemd units to ensure services and sessions inherit the intended mask. Next steps Start by picking a conservative umask and making it persistent in your shell files, then test common workflows to ensure you did not break collaboration; to deepen skills, consider formal Linux certification and focused exam prep at bitsandbytes.academy for CompTIA Linux+ or LPIC-1. Join Bits & Bytes Academy First class LINUX exam preparation. setup filesystem security scripting utilities