You can add a umask command in your .profile command. .profile and /etc/profile don't run until you login again. If you su to a new user, you will still be using your own environment unless you specify a login shell.
su -l <user>
--
Somewhat related. Here is a segment of my systems /etc/profile script:
Code:
#
# The user file-creation mask
#
# The global umask value is stored in /etc/login.defs and
# will be set by pam_umask.so (see "man pam_umask").
#umask 022
Quote:
Originally Posted by man pam_umask
DESCRIPTION
pam_umask is a PAM module to set the file mode creation mask of the current environment. The umask affects the default
permissions assigned to newly created files.
The PAM module tries to get the umask value from the following places in the following order:
- umask= argument
- umask= entry of the users GECOS field
- pri= entry of the users GECOS field
- ulimit= entry of the users GECOS field
- UMASK= entry from /etc/default/login
- UMASK entry from /etc/login.defs
|
So you might want to do some reading in your systems /etc/profile file & man pam_umask to see if there are differences.