1830979 Members
2013 Online
110018 Solutions
New Discussion

Re: umask

 
SOLVED
Go to solution
David Peacock
Frequent Advisor

umask

Our users have the setting, umask 770, in
a /usr/local/bin/custom.profile
They are directed to this file from their /home/username/.profile

When they do umask at the unix prompt it returns,

>umask
07

That seems correct. So, when the user creates a file the permissions should be rwxrwx---

But, when the users create a file the permisssions are rw-rw----

Why isn't umask working?

I did a grep for umask in /etc/profile and /home/username/.profile and there is no mention of umask

veni, vidi, vmstat
5 REPLIES 5
Patrick Wallek
Honored Contributor

Re: umask

With a umask of 07 (007) the permissions of -rw-rw---- is correct. Remember that umask is the bits that will be SUBTRACTED from the permissions of a file. Default permissions I think for a user created file a -rw-rw-rw- so 007 subtracts the rw permissions for world.

A umask of 770 is not one that you would want. That would make files that are created have permissions of -------rw- which wouldn't do your users much good.

I could see having a umask of 077 which would make a file the user created be -rw------- so that it would be readable JUST by the user.
Ravi_8
Honored Contributor

Re: umask

Hi,
ask your users to set the umask to 007.
never give up
R Madhavan
Frequent Advisor
Solution

Re: umask

HPUX creates any file without x permission and directories with x permission. The umask only take away from the default values of the file creation. By setting the umask 007, rw is taken away for others. We can only take away the file creation attributes but i do not think there is a way to create file default with x permission.
David Peacock
Frequent Advisor

Re: umask

CORRECTION:

The users have umask set at 007 in
/usr/local/bin/custom.profile
veni, vidi, vmstat
Patrick Wallek
Honored Contributor

Re: umask

David,

If the users umask is set to 007, then the file that are created by the user will have permission of -rw-rw----. As has been said, files are created with rw- permission for owner, group and world, no execute permissions, so umask is behaving normally by subtracting all permissions from world.