Weird result when adding users and groups

Chat about Linux in general
Post Reply
JamesFox
Level 1
Level 1
Posts: 33
Joined: Sat Mar 14, 2009 1:46 pm

Weird result when adding users and groups

Post by JamesFox » Fri Feb 26, 2010 6:47 pm

Hi all! I thought I'd run this by the mint community for fun. (Clearly my idea of "fun" is questionable :)).

I am taking a linux admin class, and right now the subject is setting up users and groups. We have five groups, and each group is going to have a dozen users. Instead of adding the users and then modifying them one by one to put them in the right group, we decided to use the "adduser" command. First though, we edited the /etc/adduser.conf file. Here's the part we edited: (taken from this site: http://www.digipedia.pl/man/doc/view/ad ... onf.5.html)

"USERGROUPS
If this is set to yes, then each created user will be given their own group to use. If this is no, then each created user will be placed in the group whose GID is USERS_GID (see below). The default is yes.

USERS_GID
If USERGROUPS is no, then USERS_GID is the GID given to all newly-created users. The default value is 100."

We changed the USERGROUPS to "no", and we changed the USERS_GID to the number of the first group we were going to add our users to.

This worked as expected. As an example, our first group was "north office". We created a user named "bobsmith" using the "adduser" command, and when we logged in as him and typed the "groups" command, it came back with "north office" (again, as expected.) Here's the weird part, and what even stumped my teacher: when we looked at the /etc/group file, it does not show "bobsmith" added to the "north office" group. Basically, adding users with this method is not updating the /etc/group file whatsoever, and I (and more importantly my teacher) thought this was where all group info was pulled from. What are we missing? Is there another file where these settings are being stored? Since I was able to log in as "bobsmith" and see that he was in the right group, I'm somewhat happy... but I'm more worried that not having the /etc/group file up to date is going to come back and haunt me down the road.

I hope I explained this in some manner that makes sense. Let me know if anyone has any thoughts or guesses!

Husse
Level 23
Level 23
Posts: 18703
Joined: Sun Feb 11, 2007 7:22 am
Location: Near Borås Sweden

Re: Weird result when adding users and groups

Post by Husse » Fri Mar 05, 2010 6:34 pm

You forgot about /etc/passwd
Your user is stored there (well not the user himself :) - I discovered the ambiguity right after I typed)
Some references
http://www.cyberciti.biz/faq/understand ... le-format/
http://docstore.mik.ua/orelly/networkin ... h04_01.htm
http://www.yolinux.com/TUTORIALS/LinuxT ... roups.html
http://tuxtraining.com/2008/03/13/under ... nd-etcskel
Image
Don't fix it if it ain't broken, don't break it if you can't fix it

Post Reply

Return to “Chat about Linux”