1847476 Members
2563 Online
110265 Solutions
New Discussion

umask question.

 
SOLVED
Go to solution
joe_91
Super Advisor

umask question.

Hi There:

We are using our own program to add users in an NIS environment. i found currently the umask is set to 00. what would be a good value for the umask to be set and if so what should be the best place to set it?(/etc/profile)? so that the current environment should continue to work smoothly. Thanks in advance

Joe.
8 REPLIES 8
A. Clay Stephenson
Acclaimed Contributor
Solution

Re: umask question.

At least set it to 002. 022 is my preference and /etc/profile is the place. Note that if set in /etc/profile and a umask setting in .profile will override it (as would a umask command entered at the shell).
If it ain't broke, I can fix that.
Sridhar Bhaskarla
Honored Contributor

Re: umask question.

Hi Joe,

I will be very happy if my users can let me set '077' that leaves a default of 700 permissions.

However '022' is appropriate for most of the cases.

You can set it in /etc/profile to make it global.

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
Arockia Jegan
Trusted Contributor

Re: umask question.


As per my knowledge the best value is 077. The owner will have the full permission and the group and world will have null permission.

But most of the people use 022 to give moderate permission to group and world.
Arockia Jegan
Trusted Contributor

Re: umask question.

/etc/profile is the global place to setup this value. If any indvidual user wants to have different umask value they can override that value(umask value setup in /etc/profile) by setting up the umask value in their .profile file.
Hai Nguyen_1
Honored Contributor

Re: umask question.

Joe,

022 is appropriate in most cases. And you can have it included in suitable profiles under /etc depending on a user's default shell.

Hai
joe_91
Super Advisor

Re: umask question.

Thanks Folks!!!!

Joe.
PIYUSH D. PATEL
Honored Contributor

Re: umask question.

Hi,

022 or 077 is best you can leave.

Piyush
Bill Hassell
Honored Contributor

Re: umask question.

How long has the system been installed? The default HP-UX installation never sets umask and thus, every file and directory created by root as well as users has been compromised. (well, maybe not, but how will you know?)

In other words, with 777 and 666 permissions all over the system, you can't trust the contents and will have to verify each file and directory. To get an idea of the magnitude of the problem, use this command:

find / -local \( -type f -o -type d \) -perm -002 -exec ll -d {} \; | more



Bill Hassell, sysadmin