LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   default fmask, dmask, umask (https://www.linuxquestions.org/questions/linux-general-1/default-fmask-dmask-umask-944740/)

Nick_C 05-13-2012 10:51 AM

default fmask, dmask, umask
 
Can anyone tell me what the default values are for fmask, dmask, umask and how can I change these default values. How can I read what the current values are for a particular mount?

Thanks,
Nick

tronayne 05-14-2012 08:29 AM

UMASK is usually set system-wide somewhere in /etc; on my systems it is set in the file login.defs:
Code:

# Default initial "umask" value.
# UMASK is also used by useradd and newusers to set the mode of new home
# directories.
# 022 is the default value, but 027, or even 077, could be considered
# better for privacy. There is no One True Answer here: each sysadmin
# must make up her mind.
UMASK          022

You can see the UMASK value with the shell built-in:
Code:

prompt: umask
0022

This default value is, generally, the "right" one for most purposes in that directories are created with drwxr-xr-x and files are created with -rw-r--r-- (what you see when you do a long listing with ls -l). The owner of either a file or directory has full read-write, the group can read and public can read. You can fiddle with UMASK system-wide (not such a good idea) or on a user-by-user basis in their individual .profile files (when they log in UMASK is set for their session). Be sure and read the umask manual page for what and how to do that.

fmask and dmask default to the value of UMASK of the current process (see the manual page for mount), fmask and dmash can be optionally set by mount.

Hope this helps some.

Nick_C 05-14-2012 10:53 AM

Thanks tronayne, UMASK setting in /etc/login.defs now found, that is set to 077. However 'umask' returns: 0002. Not sure how that relates to the default fmask & dmask though.

Cheers,
Nick


All times are GMT -5. The time now is 12:45 AM.