LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-12-2013, 06:36 PM   #1
thiyagusham
Member
 
Registered: Apr 2012
Posts: 213

Rep: Reputation: Disabled
umask for foo oracle root users


Hello to all;

Good Morning to Everyone.

I am from India.
i have some confusion with umask. I know this is very question but i want clarify some doubts.

>> FROM ORACLE USER >>
PHP Code:
whoami
oracle
umask
0022 
>> AS ROOT USER >>

PHP Code:
# whoami
root
# umask
0022 
>> FROM foo user >>

PHP Code:
whoami
foo
umask
0002 
# root user umask is 0022 and oracle user umask is 0022
but foo user 0002

user foo and user oracle both are local user why umask differs here ?

Last edited by thiyagusham; 01-12-2013 at 06:38 PM.
 
Old 01-13-2013, 11:03 AM   #2
shivaa
Senior Member
 
Registered: Jul 2012
Location: Grenoble, Fr.
Distribution: Sun Solaris, RHEL, Ubuntu, Debian 6.0
Posts: 1,800
Blog Entries: 4

Rep: Reputation: 286Reputation: 286Reputation: 286
Umask is a value set in your profile file i.e. in /etc/profile or as far as I remember somewhere in .bashrc (for bash shell) or .cshrc (c shell) or in ~/.login. It's used to set permission mode on files that you create.

Any file that you create, gets permission based on umask value set in your profile. If umask is set to 0022, then the newly created file will get permission mode of 644.

In your case, you are getting different values, because they're set in corresponding user's profiles. Root and Oracle user are getting 0022 from /etc/profile as they may not have umask set in their personal profile file.

Anyway, you can find it as:-
Code:
grep -i umask ~/*
OR
grep -i umask /etc/profile

Last edited by shivaa; 01-13-2013 at 11:05 AM.
 
Old 01-13-2013, 11:09 AM   #3
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 17,926

Rep: Reputation: 3690Reputation: 3690Reputation: 3690Reputation: 3690Reputation: 3690Reputation: 3690Reputation: 3690Reputation: 3690Reputation: 3690Reputation: 3690Reputation: 3690
Quote:
Originally Posted by thiyagusham View Post
Hello to all;
I am from India. i have some confusion with umask. I know this is very question but i want clarify some doubts.

# root user umask is 0022 and oracle user umask is 0022 but foo user 0002

user foo and user oracle both are local user why umask differs here ?
You need to understand what umask is, and how it works...did you look up anything regarding umask yet?
http://en.wikipedia.org/wiki/Umask
http://linuxzoo.net/page/sec_umask.html
http://www.cyberciti.biz/tips/unders...lue-usage.html

A umask of 022 allows only you to write data, but anyone can read data....umask of 002 is for sharing data with members of the same group. Different user permissions/setup = different umasks and rights.
 
1 members found this post helpful.
Old 01-13-2013, 11:58 AM   #4
thiyagusham
Member
 
Registered: Apr 2012
Posts: 213

Original Poster
Rep: Reputation: Disabled
Hi tbone ;

Thanks for your reply. I know basic umask settings.
i asked by default why both user having different value ? [ it's my ques]
I was waiting for long time to get reply. Just now i got reply from here.
but i already done few testings. I am sharing here.

>> Usr1 with Primary Group and umask is 0022 >>

PHP Code:
#  useradd  -g  oinstall    usr1
usr1   umask  :  0022
$  mkdir  sample
$  touch   sample.txt
$  ls  -ld   sample  sample.txt 
PHP Code:
drwxr-xr-x  2    usr1    oinstall    4096   Jan 13 20:32 sample
-rw-r--r--  1    usr1    oinstall    740   Jan 13 20:33 sample.txt 
Quote:
DIR =777 022 = 755 (rwxr-xr-x) and
FILE = 666-022=644 (-rw-r--r-- )
>> User(rose) with oinstall(secondary) and umask is 0002 >>

PHP Code:
#  useradd  -G  oinstall    rose
usr1   umask  :  0002
# mkdir sample
touch  sample.txt
ls  -ld sample sample.txt 
PHP Code:
drwxrwxr-x  2    rose  rose  4096   Jan 13 20:38 sample
-rw-rw-r--  1   rose   rose    680  Jan 13  20:40 sample.txt 
Quote:
DIR =777 002 = 775 (rwxrwxr-x) and FILE = 666-022=644 (-rw-rw-r-- )
Why i posted this .. A

usr1 added with primary (-g) oinstall group so umask is 0022
rose user added with secondery (-G) oinstall group so umask is 0002.
Even rose user with oinstall group , o/p showing group name is "ROSE".please see 2nd o/p.
Please reply am i right ? i am not a linux guy i belong oracle background. i need clarification for what i posted above output.
Please reply ... Expecting reply .......
 
Old 01-13-2013, 12:27 PM   #5
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 17,926

Rep: Reputation: 3690Reputation: 3690Reputation: 3690Reputation: 3690Reputation: 3690Reputation: 3690Reputation: 3690Reputation: 3690Reputation: 3690Reputation: 3690Reputation: 3690
Quote:
Originally Posted by thiyagusham View Post
Hi tbone ;
Thanks for your reply. I know basic umask settings. i asked by default why both user having different value ? it's my ques.
If you already know what umask is, then that answers your question. Again, the umasks will vary, depending on how the user was set up, and what permissions that user has, simple as that.
Quote:
I was waiting for long time to get reply. Just now i got reply from here.
"Long time"?? Less than 24 hours...if you need a faster answer, then you need to have a version of Linux with paid-for tech support (like Red Hat Enterprise or SuSE Enterprise), and call them. Otherwise, it's fairly rude to say things like "I was waiting for long time", on a VOLUNTEER forum.

Quote:
but i already done few testings. I am sharing here.


Why i posted this. A usr1 added with primary (-g) oinstall group so umask is 0022
rose user added with secondery (-G) oinstall group so umask is 0002.
Eve n rose user with oinstall group, o/p showing group name is "ROSE". please see 2nd o/p.
Please reply am i right ? i am not a linux guy i belong oracle background. i need clarification for what i posted above output.
Please reply ... Expecting reply .......
Again, such things are fairly rude on a volunteer forum.

AGAIN...different user setups = different umasks. Doesn't get much simpler than that. Again, read the explanations/descriptions of umask that were given to you. If you're not a Linux guy, you should be able to ask your Linux administrators at your organization if you have further questions, or you don't understand the umask documentation that was given to you previously.
 
Old 01-13-2013, 12:46 PM   #6
thiyagusham
Member
 
Registered: Apr 2012
Posts: 213

Original Poster
Rep: Reputation: Disabled
Hello TBone ;

I asked clarification for my doubts.
What mistake i made ? Yes., you are discouraging me !

I had some doubts, i need clarification so that i posted.
Unix team is different , Oracle tam is different.
Every time , i can't ask my doubts to unix team.

If you ask what is umask ?.. i can explain Everything ..

If i post anything wrong ! I am sorry !! but you did n't answer to my question.

Thanks Guru !
 
Old 01-13-2013, 12:55 PM   #7
thiyagusham
Member
 
Registered: Apr 2012
Posts: 213

Original Poster
Rep: Reputation: Disabled
Hello Shivaa ;

I did n't get any o/p.

From root user ..

# grep -i umask ~/*
No output .

As oracle user ..

Quote:
su - oracle
Password:
$ grep -i umask /etc/profile
$ grep -i umask ~/*
grep: /home/oracle/700: Permission denied
grep: /home/oracle/777: Permission denied
grep: /home/oracle/asdf.txt: Permission denied
grep: /home/oracle/kb: Permission denied
grep: /home/oracle/sqlscript: Permission denied
grep: /home/oracle/sqlscript.txt: Permission denied
 
Old 01-13-2013, 12:56 PM   #8
shivaa
Senior Member
 
Registered: Jul 2012
Location: Grenoble, Fr.
Distribution: Sun Solaris, RHEL, Ubuntu, Debian 6.0
Posts: 1,800
Blog Entries: 4

Rep: Reputation: 286Reputation: 286Reputation: 286
There is not co-relation between umask and group either primary or secondary. As TB0ne pointed different user's have different settings.

If umask isn't set in user's personal profile file, then it will consider /etc/profile file for the same.

For any user you can check, if it's set in user's profile or not as:
Code:
grep -i 'umask' .profile
OR you can search in different shell initialization files.
 
1 members found this post helpful.
Old 01-13-2013, 12:59 PM   #9
thiyagusham
Member
 
Registered: Apr 2012
Posts: 213

Original Poster
Rep: Reputation: Disabled
Hello Shiva;

I am asking concept of umask. or i am not lerning linux here.
My straight ques is compare rose vs usr1

when user added with oinstall or any group (-g) , umask will be 0022
when user added with oinstall or any group (-G) , umask will be 0002

This is my ques ... please clarify. Normal umask settings i know very well

Thnaks Shivaa !!
 
Old 01-13-2013, 01:00 PM   #10
shivaa
Senior Member
 
Registered: Jul 2012
Location: Grenoble, Fr.
Distribution: Sun Solaris, RHEL, Ubuntu, Debian 6.0
Posts: 1,800
Blog Entries: 4

Rep: Reputation: 286Reputation: 286Reputation: 286
Search in following files:
Code:
grep -i 'umask' .profile .bashrc
Also it should be there in /etc/profile as well:-
Code:
grep -i umask /etc/profile
 
Old 01-13-2013, 01:07 PM   #11
thiyagusham
Member
 
Registered: Apr 2012
Posts: 213

Original Poster
Rep: Reputation: Disabled
Hi shiva ;

I am n't getting any o/p. i cant access unix team operations.
However i belong oracle background.

Could you please clarify little more ?

You are saying " not co-relation between umask and group either primary or secondary "
why my system showing different o/p ?
 
Old 01-13-2013, 01:16 PM   #12
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 17,926

Rep: Reputation: 3690Reputation: 3690Reputation: 3690Reputation: 3690Reputation: 3690Reputation: 3690Reputation: 3690Reputation: 3690Reputation: 3690Reputation: 3690Reputation: 3690
Quote:
Originally Posted by thiyagusham View Post
Hello TBone ;
I asked clarification for my doubts.
What mistake i made ? Yes., you are discouraging me !
What mistakes?? Did you not read what was posted?? You complained about having to wait a long time, then told us you were EXPECTING a reply. Sorry, but your question was answered within 24 hours, and (as VOLUNTEERS), you don't 'expect' anything from us. And if someone telling you you're being rude is 'discouraging', that's not a problem anyone else can fix but you.
Quote:
I had some doubts, i need clarification so that i posted. Unix team is different , Oracle tam is different. Every time , i can't ask my doubts to unix team.
The word "doubt" and the word "question" have different meanings. And yes, I realize they are different teams...but they are YOUR COWORKERS. If you have questions, you should be able to talk to each other.
Quote:
If you ask what is umask ?.. i can explain Everything ..
Then why are you asking a question about why umasks are different?
Quote:
If i post anything wrong ! I am sorry !! but you did n't answer to my question.
I answered your question several times. It appears you aren't understanding the answer.

AGAIN...if you set up users differently, they will have different settings. Period...that's it. That's your answer. Different primary groups = different inherited umasks. AGAIN...see the documentation on umask, since that explains things in greater detail.
 
1 members found this post helpful.
Old 01-13-2013, 01:18 PM   #13
thiyagusham
Member
 
Registered: Apr 2012
Posts: 213

Original Poster
Rep: Reputation: Disabled
Hi ;

Oracle team members cant issue unix related command in my env ..
So i can't check the what command you mentioned above?

If you provide ,some explanation i will get clear idea,
 
Old 01-13-2013, 01:33 PM   #14
shivaa
Senior Member
 
Registered: Jul 2012
Location: Grenoble, Fr.
Distribution: Sun Solaris, RHEL, Ubuntu, Debian 6.0
Posts: 1,800
Blog Entries: 4

Rep: Reputation: 286Reputation: 286Reputation: 286
-g option is used to specify primary group of the user when you create it.
-G option is used to specify secondary or any alternative group of the user when you create it.

When you use -g option with useradd, it adds "oinstall" or whichever group you specified with it, as primary group for that user (let's say testuser). And when that user creates any new file, let's say sample.txt, then the file by default gets that user's primary group i.e. oinstall or whichever it is.
Just have a look:-
Code:
~$ useradd -g oinstall testuser
~$ su - testuser
~$ touch sample.txt
~$ ls -la sample.txt
------ testuser oinstall sample.txt
On the other hand, when you use -G option with useradd, it add "oinstall" or whichever group you specified with it, as secondary/alternative group for that user.

FYI, oinstall is a group used by those who manage databases. So when you set "oinstall" as primary group, it sets umask to 0022 for that user, so any new file created by that user can get 644 permission. Point to note here, 6 stands for owner, 4 stands for group and 4 stands for others respectively. This means, group member of "oinstall" can also have write permission on that file.

If a user do not have "oinstall" as primary group, then he will not get write permission on that database file, that's why he has umask 0002.

Hope it will clear your doubts.

If you still have any doubts, once go through manual of useradd and chmod.
Code:
~$ man useradd
~$ man chmod
Quote:
I am asking concept of umask. or i am not lerning linux here.
Be assured, we're not here to teach you linux. And do not get impatience, because all here are volunteers, who spend their precious time and best efforts to help you, so just be cool

Last edited by shivaa; 01-13-2013 at 01:41 PM.
 
Old 01-13-2013, 01:50 PM   #15
thiyagusham
Member
 
Registered: Apr 2012
Posts: 213

Original Poster
Rep: Reputation: Disabled
Hi Shivaa ;

Ya , i know , All volunteers, who spent their precious time and best efforts to help me !! I feel very luckY !

Lot of thanks !! I got your answer. really i am n't learing Linux here.

Resolved !! Thanks a lot !! and Thanks Tbone !!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Apache: RewriteRule - redirect /foo only works if /foo exists ezekieldas Linux - Software 2 07-31-2012 12:45 PM
[SOLVED] Directory for vimrc so it's usable by both root and user foo. stf92 Slackware 12 01-30-2011 01:22 AM
finding umask for all users using script logicalfuzz Linux - General 5 02-16-2010 08:02 PM
Set default umask for users wjs1990 Linux - Newbie 1 01-04-2010 10:44 PM
fstab, umask and users permissions foucault Linux - Security 3 11-03-2005 02:13 AM


All times are GMT -5. The time now is 05:11 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration