1748060 Members
5817 Online
108758 Solutions
New Discussion юеВ

umask

 

umask

Hello, here is my question. First what is the real default umask value or permission on HP-UX. Is it 022? How come all books says to set default permission use command umask 000? Can you explain?
10 REPLIES 10
James R. Ferguson
Acclaimed Contributor

Re: umask

Hi Stephane:

You should establish an appropriate default umask for every user in the user's profile.

For root, this should be at least 022 or even 027. For all other users, 022 is very appropriate.

Setting the umask to 000 would simply mean that directories are created with octal permissions 777 (read, write, execute for the owner, group and world); and files with octal 666 (read, write).

This is far too insecure.

Regards!

...JRF...
A. Clay Stephenson
Acclaimed Contributor

Re: umask


There is no default umask setting and thus it becomes 0000. Generally one of the first things you do is edit /etc/skel/.profile and add a umask value there so that when new users are created they get a defined umask value.

You books are telling you to set umask to 000 so that when software in installed/copied that the original modes of the files are retained. There are two components in play when a file is created: 1) the mode 2) umask. Umask "subtracts" from mode. (it really isn't subtraction but you can think of it that way). By setting umask to 000, no "subtraction" occurs and the files are installed with their mode intact. This may not be a good thing because running with umask 0000 is normally a security risk.
If it ain't broke, I can fix that.

Re: umask

Tks for your replay. But I am asking these questions because they are part of the study book for the HP-UX system CSA exam and I don,t really get it. Here are the question on the book.

What is the default umask value in HP-UX?
A. 002
B. 022
C. 222
D. 200


What command will you use to ensure that the default permissions are being used?

A. setperm 777
B. setperm
C. setperm umask
D. umask 000

So I would say B to the fisrt question and D to second question, but still don't get it.

Peter Nikitka
Honored Contributor

Re: umask

Hi,

I think the is a default setting in
/etc/profile
which is used for all users with Bourne-shellstyle and in
/etc/*csh* OR /etc/.login
for those with Cshell style.

mfG Peter
The Universe is a pretty big place, it's bigger than anything anyone has ever dreamed of before. So if it's just us, seems like an awful waste of space, right? Jodie Foster in "Contact"
A. Clay Stephenson
Acclaimed Contributor

Re: umask

This illustrates what I consider to be wrong with the entire certification process.

What is the default umask value in HP-UX?
A. 002
B. 022
C. 222
D. 200

The "real" answer is none of the above because an untrusted system has a default umask of 0 and a trusted system has a umask of 077. The question is also a bit nebulous in that the specific version of HP-UX is not mentioned so that really old versions might be different.


What command will you use to ensure that the default permissions are being used?

A. setperm 777
B. setperm
C. setperm umask
D. umask 000

In this case D is correct because with a umask of 000 the permissions (more properly "mode") will be left intact.
If it ain't broke, I can fix that.
Ivan Ferreira
Honored Contributor

Re: umask

For the first is 022, this is the default, for the second, I think that there is something wrong with the question. No answer is right. The answer should be umask 022.

Sometimes, these errors happens on study guides.
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
Bharat Katkar
Honored Contributor

Re: umask

What is the default umask value in HP-UX?
A. 002
B. 022
C. 222
D. 200
Ans: B

What command will you use to ensure that the default permissions are being used?

A. setperm 777
B. setperm
C. setperm umask
D. umask 000

Ans: D

These are the expected answers.

Regards,
You need to know a lot to actually know how little you know
Jeff_Traigle
Honored Contributor

Re: umask

As Ivan points out, you really must be careful relying on the questions and answers in Raqeef's study guide. I found numerous errors in the first edition I used to study for the CSA exam back in 2001. I haven't read the second edition so don't know if much improvement was made.

Use the study guide as just that... a guide. If there's anything that isn't clear, looks contradictory, or you just want verification of its validity, always use the primary sources of information... man pages and other documentation that you can find on http://docs.hp.com/.
--
Jeff Traigle
Richard Darling
Trusted Contributor

Re: umask

I always check for any errata that may have been found since the publishing of a technical book. For Rafeeq's book it is:

http://www.hp.com/hpbooks/prentice/ptr_0130183741.html

You will see the 'publishers errata' on the right-hand side. I sent Rafeeq a list of seven errors from the first publishing in 2000, and he was extremely appreciative.

rdarling@southwickclothing.com