Visit Our UNIX and Linux User Community


Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers user/group
# 1  
Old 03-07-2002


Herez the scenario

1. logged in as user xxxx

$ id
uid=125(xxxx) gid=101(my_grp) groups=0(system),15(users),16(sysadmin),19(adm),110(appl)

$ touch test
$ ls -la test
-rw-r--r-- 1 xxxx system 0 Mar 7 14:31 test

Why is the group of the file test 'system' and not 'my_grp' as I was expecting it? Smilie

Any thoughts?

# 2  
Old 03-07-2002
What version of OS? (Mind didn't show all my groups when I typed just the id command, I had to add a -a).

Check the .profile, .login, .kshrc, .cshrc (it matters which shell you are using) for any lines that are changing your default group to another. It's possible but unlikely that it is in /etc/profile where the change is being made.

That's a start...
# 3  
Old 03-08-2002
Originally files were created with the uid and gid of the process that created them. But when BSD came out they introduced multiple groups. They also decided, for some odd reason, that new files would take the gid of the directory in which they were created.

HP-UX and SunOS both copied multiple groups from BSD. But they have new files get the gid from the creating process just like System V. However they both have a secret way to obtain the old BSD behavior. If a directory has the sgid turned on, then new files are created with the same gid as the directory, not the process.

It's not easy to get that bit turned on. On HP-UX you must be root and "chmod 2755 ." did the trick. With SunOS, not only did I have to be root but also I was forced to use the mystic incantation "chmod g+s ." to turn that bit on. Once I got the bit turned on, both OS'es exhibited the BSD behavior.

So take a look at the directories permissions, I'll bet that is the answer. And I too would like to know which OS you are using. I wonder how far this concept has spread.

Previous Thread | Next Thread
Test Your Knowledge in Computers #491
Difficulty: Easy
In general, interpreted languages are slower than compiled languages.
True or False?

10 More Discussions You Might Find Interesting

1. Red Hat

User is a Part of a Group But Group Details Do Not Show the User

Hi, In the following output you can see the the user "richard" is a member on the team/group "developers": # id richard uid=10247(richard) gid=100361(developers) groups=100361(developers),10053(testers) but in the following details of the said group (developers), the said user... (3 Replies)
Discussion started by: indiansoil
3 Replies

2. Linux

Nobody user group in Linux

Hi I am facing problem of taking backup of file system as username1. There are some files in system which is having group ownership as nobody. and username1 is not able to open this file and backup is failing .Even as a root user I can not open this file. File which is creating problem is ... (1 Reply)
Discussion started by: devesh123
1 Replies

3. Shell Programming and Scripting

user without group

hi i have vert strange query.. can we add user in unix with out assigned it to any group i mean user which is having no default group or anything.. like this in /etc/passwd file new_user:::::::: Please help (2 Replies)
Discussion started by: aishsimplesweet
2 Replies

4. Debian


Can someone help in creating a group and user. syntax to create a Group called Members. syntax to create a user called AAAA and place in to the Group Members. Thanks for your help in Advance. (3 Replies)
Discussion started by: sawyer
3 Replies

5. Ubuntu

Create New User with the same group nd privileges of the other user

Hi, Anyone can help me on how to duplicate privileges and group for useroradb01 to userrootdb01. I have currently using "useroradb01" and create a newly user "userrootdb01". I want both in the sames privileges and group. Please see the existing users list below; drwxr-xr-x 53 useroradb01... (0 Replies)
Discussion started by: fspalero
0 Replies

6. Shell Programming and Scripting

user and its group

Hello, is there any command which can show a particular user "xyz" is belongs to how many groups thanks (3 Replies)
Discussion started by: lookinginfo
3 Replies

7. Shell Programming and Scripting

Find all files with group read OR group write OR user write permission

I need to find all the files that have group Read or Write permission or files that have user write permission. This is what I have so far: find . -exec ls -l {} \; | awk '/ {print $1 " " $3 " " $4 " " $9}' It shows me all files where group read = true, group write = true... (5 Replies)
Discussion started by: shunter63
5 Replies

8. Solaris

Adding User to group

Hi all, I have a existing user user1 its group id dba i have created a new user named: uta and added to group dba my task for creating uta ( to ftp solaris server from /oracle/pcmia/dry1 & oracle/pcmia/dry2 and get some rdf ( database patch) and saved in one windows folder named d:\patch... (2 Replies)
Discussion started by: saurabh84g
2 Replies

9. UNIX for Dummies Questions & Answers

User and Group Structure

I was asked to set up a unix system and i am at a loss. i need to know the best one for a small to medium sized business and how to go about setting up the uids and the guids for the network. what permissions i have available and such. (1 Reply)
Discussion started by: dwchapman
1 Replies

10. UNIX for Dummies Questions & Answers

User Group

I can't get a clear answer on this one... I have a Oracle user created in group 'dba' when this user touches a file the group displayed is 'sys' - why? The 'sys' group is not included in the list of secondary groups for this user. Is this standard to Oracle on Unix? (AIX) Anybody? (1 Reply)
Discussion started by: errolg
1 Replies

Featured Tech Videos