Issues with umask

Are there any known issues with umask. I have having a problem that some of the new files are not created with the default permissions of umask 002.
Wondering if anyone of you could have an answer to this
Cheers,
Neeraj

neerajchallana,

Couple of questions. My answer is from the point of view of HPUX OS.

What OS version do you have?
Are you trying to do this remotely?

Perform these commands and see what you get.

   umask
   umask -S
   remsh systemname umask
   remsh systemname umask -S

Check your /etc/profile. It is the default profile for users if they don't have a .profile in their home directory.

Also, check in each affected user's home directory .profile. Do "grep umask .profile" in the user's home dir. If you get nothing then you will need to modify their .profile and add a line like this:

    umask 002

:wq!

I have recently found out that if you execute remsh with your system name and umask, you get the DEFAULT for the system type you have regardless of the umask that you set when files are created. This is a security measure built into the OS, at least for HPUX.

On "trusted" systems, the default umask for remote access is 066.

On an non-trusted system, the default umask is 000.

Also, another little tidbit. If you set your umask to some exe permissions, like umask 000. Touch a file and check the permissions on it. I guarantee you it will only be 666! Do it and find out.

# umask 000
# touch file1
# ls -l file1
-rw-rw-rw- file1

This maybe too much info, but I just had an issue with umask and remsh.