LinuxSecurity.com: Using umask | Linux Today

LinuxSecurity.com: Using umask

Written By
Web Webster
Web Webster
Jul 11, 2000

[ Thanks to Benjamin
D. Thomas
for this link. ]

“The umask command controls the default file and directory
creation mode for newly-created files and directories. It is
recommended that you make root’s umask 077, which will disable
read, write, and execute permission for other users, unless
explictly changed using chmod.”

“The umask command can be used to determine the default file
creation mode on your system. It is the octal complement of the
desired file mode. If files are created without any regard to their
permissions settings, a user could inadvertently give read or write
permission to someone that should not have this permission.”

“The umask for the creation of new executable files is
calculated as follows:

777 Default Permissions -022 Subtract umask value, for example ----- 755 Allowed Permissions  

So in this example we chose 022 as our umask. This shows us that
new executables that are created are given mode 755, which means
that the owner can read, write, and execute the binary, while
members of the group to which the binary belongs, and all others,
can only read and execute it.”

Complete
Story

Web Webster

Web Webster

Web Webster has more than 20 years of writing and editorial experience in the tech sector. He’s written and edited news, demand generation, user-focused, and thought leadership content for business software solutions, consumer tech, and Linux Today, he edits and writes for a portfolio of tech industry news and analysis websites including webopedia.com, and DatabaseJournal.com.

Linux Today Logo

LinuxToday is a trusted, contributor-driven news resource supporting all types of Linux users. Our thriving international community engages with us through social media and frequent content contributions aimed at solving problems ranging from personal computing to enterprise-level IT operations. LinuxToday serves as a home for a community that struggles to find comparable information elsewhere on the web.

Property of TechnologyAdvice. © 2026 TechnologyAdvice. All Rights Reserved

Advertiser Disclosure: Some of the products that appear on this site are from companies from which TechnologyAdvice receives compensation. This compensation may impact how and where products appear on this site including, for example, the order in which they appear. TechnologyAdvice does not include all companies or all types of products available in the marketplace.