Operating System - HP-UX
1834608 Members
3325 Online
110069 Solutions
New Discussion

change default UMASK on trusted system ?

 
SOLVED
Go to solution
Andrew_4
Honored Contributor

change default UMASK on trusted system ?

Just a quicky...

How do I go about changing the default umask on a trusted system ??

Will give points..

Andrew
The Unix Programmer's Manual, 2nd Edition, June, 1972: "The number of Unix installations has grown to 10, with more expected."
3 REPLIES 3
Philip Chan_1
Respected Contributor
Solution

Re: change default UMASK on trusted system ?

Just append the following codes into your /etc/profile file.

if [ "$WHO" = "root" ]
then
umask 077
else
umask 027
fi


That will do.

Rgds,
Philip
Philip Chan_1
Respected Contributor

Re: change default UMASK on trusted system ?

Oaks... lefted one line in my previous message.

export WHO=`whoami`

So the whole thing should look like

export WHO=`whoami`
if [ "$WHO" = "root" ]
then
umask 077
else
umask 027
fi


~Philip
Vincenzo Restuccia
Honored Contributor

Re: change default UMASK on trusted system ?

Change in $HOME/.profile the value of umask.