Fundamentals 4 min read

How to Permanently Change the Umask Value on Linux Systems

This tutorial explains what the umask setting does, shows the octal permission masks, and provides step‑by‑step instructions for permanently modifying the default umask in a user’s shell profile or /etc/profile on any Linux distribution.

MaGe Linux Operations
MaGe Linux Operations
MaGe Linux Operations
How to Permanently Change the Umask Value on Linux Systems

This tutorial guides Linux users on how to permanently change their system's umask value, especially useful for newly installed systems.

Umask (user file‑creation mask) defines the default permissions for newly created files and directories.

The following octal values represent different permission masks:

0 – read, write, execute (rwx)

1 – read and write (rw-)

2 – read and execute (r-x)

3 – read only (r--)

4 – write and execute (-wx)

5 – write only (-w-)

6 – execute only (--x)

7 – no permissions (---)

Most Linux distributions default to a umask of 0022 (or 022). You can view the current setting with the umask command, or temporarily change it by running umask 027, for example.

New files are created with default permissions of 0666 and directories with 0777; applying the umask yields typical permissions of 0644 for files and 0755 for directories.

Some consider the default 022 mask a privacy risk because it allows other users to read newly created files.

To permanently set a new umask, add a umask line to your shell’s configuration file (e.g., ~/.bashrc) or to /etc/profile.

After updating, all newly created files and directories will inherit the new permissions, though existing ones remain unchanged.

You can verify permissions with ls -lah in any directory, or via the file properties dialog in GNOME.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

LinuxShellSystem AdministrationFile Permissionsumask
MaGe Linux Operations
Written by

MaGe Linux Operations

Founded in 2009, MaGe Education is a top Chinese high‑end IT training brand. Its graduates earn 12K+ RMB salaries, and the school has trained tens of thousands of students. It offers high‑pay courses in Linux cloud operations, Python full‑stack, automation, data analysis, AI, and Go high‑concurrency architecture. Thanks to quality courses and a solid reputation, it has talent partnerships with numerous internet firms.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.