The umask enviromental variable sets the file permission for all files and directories in Linux and Unix operating systems. The variable works as a mask, and subtracts execute, write and read permissions from specified files and directories. The default permissions are 666 -- read and write for all users -- for files, and 777 -- read, write, execute for all users -- for directories. Since the default values are inherently insecure, use the umask variable to create a more secure environment.
Open a Terminal window. Type the command umask to determine the umask value, which is usually around “022."
Subtract the umask value from “666” for files and “777” for directories. For instance:
666 - 022 = 644
777 - 022 = 755
Determine the file permissions from the resulting values. The values are based on the octal code for permissions which are “4” for read permissions, “2” for write permissions and “1” for execute permissions. The value “644” for files gives the owner of the file read and write permissions while the group and others have only read permissions. The value 755 gives the owner of the directory read, write and execute permissions while the group and others have only read and execute permissions.
Type exit to close the terminal session.
Tips & Warnings
- The "chmod" command overrides the values for umask files and directories.
How to Change a Js Variable From an Address Bar
How to Calculate Umask; ehow.com. About eHow; eHow Blog; How to by Topic; How to Videos; Sitemap; Copyright © 1999-2012 Demand Media,...
How to Get a Car Loan With Bad Credit
Getting an auto loan is difficult, but not impossible, for most people with bad credit. Some finance companies specialize in giving loans...
Computer Modem Troubleshooting Code 777
How to Calculate Umask. In a Unix or Linux operating system, umask is an enviromental variable that sets the file permission for...
How to Unmask Private Calls
Receiving "caller unknown" phone calls can be frustrating when the person on the other end of the line says nothing and hangs...
How to Make Scary, Disgusting Halloween Masks
Halloween is not just for kids anymore. Adult costumes and masks are more over-the-top every year, with frightening masks and bloody clothing...
How to Unmask a Restricted Caller ID
Similar to landlines, cellphones are equipped with Caller ID capability. Essentially, when someone calls you, the phone displays the person's phone number....
How to Create Custom Commands in FileZilla
Click "Constant Speed Limit of" under the "Upload Speed Limit" category and then enter the value ... Find your existing .SQL database...
PHP Mkdir Permission Does Not Work
For example, permissions of "0777" provide read, write and execute permissions for the "owner ... use the "umask" function to set the...