Operating System - HP-UX
1753925 Members
9255 Online
108810 Solutions
New Discussion юеВ

Re: how to change the default umask of root

 
Mallikarjun B
Occasional Advisor

how to change the default umask of root

Hi,
I ahve a pre installed HP UX system 11.31 with default umask 077 how i can change thw default umask. I dont want to change in .profile file i.e umask 022. Is there any file i have to make changes?..


Thanks,
Mallikarjun Belkunde
18 REPLIES 18
Michael Steele_2
Honored Contributor

Re: how to change the default umask of root

Hi

"...I dont want to change in .profile file i.e umask 022..."

In hp-ux the default root shell is posix and posix uses .profile to execute its setup environment.

You can not change this.

If you do, i.e., go into /etc/password and change sh to ksh or csh, then you make the box unbootable, and you have to boot into single user or LVM maint mode and change /etc/passwd back to sh.
Support Fatherhood - Stop Family Law
Michael Steele_2
Honored Contributor

Re: how to change the default umask of root

Note that I am also guessing the answer to your question here because you both ask and answer by saying "...I don't want to change 'umask' in .profile...".

This is the only place you can change umask's default setting, and that will only affect the /root home directory login.

Any other place, the only other place being /etc/profile, affects every new file or directory made in the O/S and now puts the O/S into an unknown state.

'umask' is made for home directory manipulation only when placed in the login shell environment set up file, i.e., .login, .profile, .cshrc. 'umask' in /etc/profile is for the entire O/S.
Support Fatherhood - Stop Family Law
Michael Steele_2
Honored Contributor

Re: how to change the default umask of root

You know I'm going to have to back off on that "... /etc/profile is for the rest of the O/S and putting 'umask' in there will put the O/S into an unknown state...". /etc/profile will only affect new files and dirs during the user login process.

So try putting 'umask' in /etc/profile and test it out.

a) vi /etc/profile add 'umask 022' at bottom.
Verify other occurances of umask in /etc/profile but don't comment them out.

b) su - users
c) touch files

See if you get what you're looking for.
Support Fatherhood - Stop Family Law
Dennis Handly
Acclaimed Contributor

Re: how to change the default umask of root

umask for what? Various types of root logins, cron or demons?
Mallikarjun B
Occasional Advisor

Re: how to change the default umask of root

HI,
I think i have to chk in /etc/profile file. I will check today in off. and will try the solution.Some of not getting the point. That i have installed system having umask 077 and i want to change the umask to 022 without editing the /.profile file.



Thanks,
Mallikarjun Belkunde
Johnson Punniyalingam
Honored Contributor

Re: how to change the default umask of root

>>>That i have installed system having umask 077 <<<<<<

what have you installed ? you mean new installation ..?


man umask (should be able to help to understand your requirement >>i want to change the umask to 022 change the umask to 022 without editing the /.profile file.<<<
Problems are common to all, but attitude makes the difference
Chandrahasa s
Valued Contributor

Re: how to change the default umask of root

Hi,

You can find umask value set in /etc/profile you change the umask value here if umask entry not available you can add

umask 022

Chandra
Dennis Handly
Acclaimed Contributor

Re: how to change the default umask of root

>Some of not getting the point.

What are you trying to do that you can't edit /.profile?

>I want to change the umask to 022 without editing the /.profile file.

As mentioned several times, you could also edit /etc/profile to effect all real shell users.
Michael Steele_2
Honored Contributor

Re: how to change the default umask of root

Oh, I believe the instructor is asking you to run umask from the command line, and to verify with umask -S for korn shell or just 'umask' for an octal value.

The umask value will be saved via a symbolic env link.

Run info env to read more.
Support Fatherhood - Stop Family Law