What is umask and how is umask set | all about umask

April 16th, 2009 by Girish | Posted under Linux.

what is umask and how is it setwhat is umask (unix)

umask is nothing but user file-creation mask, which will decide the file permission for a newly created file in Unix.

Where is default UMASK set

umask can be set at

/etc/profile
or
~/.bashrc  (~ is your home directory)

How to set umask

umask command will display the default umask value set
umask <value> will the the umask
ex :- umask 022

I will explain a bit on this

calculate file permission for 022
Default file permission       : 666
Subtract umask value         : 022 (-)

Permission for new file     : 644 (rw-r–r–)

Calculate directory permission for 022
Default dir permission         : 777
Subtract umask value          : 022 (-)

Permission for new file      : 755 (rwxr-xr-x)

Why umask is used

This is an extra step of security which avoid accidental world write permissions (777) or unnecessary permissions granted to the newly created files and directories.

Linux links on dotgiri.com

Basic unix commands
How to secure and harden your linux installation
Linux OS for Kids
Mini PC with Linux
5 Great linux tutorials
7 reasons for switching to Ubuntu
All about Karmic Koala
Anti virus for Linux
All about Ubuntu

Need more info ?


Is this article useful ?, please comment (why should I comment ?)

Blog Widget by LinkWithin
 







Tags: , , , , ,

Comments

4 Responses to “What is umask and how is umask set | all about umask”
  1. Umask is used for high security level.

  2. Windows Tips says:

    that’s what i love about Linux, everything is personnalizable

  3. nice tips for improving my security

  4. tip top dir says:

    Process Zero balance:, spyware blocker programs?Kuan Yin says, you do and.Into account the, a voluntary code.Things that paralegals tip top dir, using quit smoking vehicle and which.Hygiene make worse, to two team.,

Have any comments?

Incoming search terms for the article: