-   Linux - General (
-   -   How to set umask (

DrRobin22 09-13-2006 05:23 PM

How to set umask
It appears that a umask issued from the command line gets subtracted :confused: from some system default. How can I set a fully open umask so that new files have permissions of 777 thereby over-riding :confused: the system defaults. Currently in my environment, entering a umask command of: umask 0000 ...thereafter will only create a file with 666 permissions.


haertig 09-13-2006 05:41 PM

umask is a "mask". You don't set file permissions directly with it (as you noted). It simply masks the default permissions. System defaults are 777 for directories and 666 for files. A umask of 000 will let the defaults come through fully (777 for directories, 666 for files). A umask of, e.g., 077, will mask the last two octets of the system defaults leaving you with mode 700 for directories and 600 for files.

There is no umask setting that will create mode 777 files for you. Use the chmod command to alter file permissions after initial creation.

fudam 09-13-2006 05:46 PM

If you're still interested in the answer (although haertig's caveat is correct), for bash look in /etc/bashrc

DrRobin22 09-13-2006 05:46 PM

Thanks Mr. Haertig...I kinda suspected that what you just said was what was going on...:rolleyes:

All times are GMT -5. The time now is 05:11 PM.