Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

What is the difference between the umask setting that can be found in /etc/profile and the cmask setting that can be found in /etc/default/init?

What is the difference between the two? When will one take effect over the other?

share|improve this question
up vote 3 down vote accepted

The manpage for init describes the contents of /etc/default/init, and says:

 CMASK      The mask (see umask(1)) that init uses and that every
            process inherits from the init process.  If not set,
            init uses the mask it inherits from the kernel.  Note that
            init always attempts to apply a umask of 022 before creating
            a file, regardless of the setting of CMASK

init starts or restarts core service components and processes, so the CMASK affects the permissions of these and any daemons spawned by init. In particular, daemons creating new directories would use this CMASK value as their umask.

The umask setting in /etc/profile will apply to logged-in users, unless overridden by their own dot-files.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.