Now, its been a while since i done this but I had to add a user to a group. I did that by using the usermod command and now when I superuser to the user's account and issue a "id", i get the desired gid.
i mean, output of id indicated the user is assigned to the group i want him to be in. also when I superuser to the users account and issued the "groups" command, the desired group name is displayed.
now, my question is, although every output of all the commands I typed indicated that this user now belongs to the group i want him to belong to, how come when i do a cat /etc/group | grep groupname, i do not see the user's name in the list of allowed users???
The default gid is in /etc/passwd and that is what you changed. This may or may not have been an error. Did you want the user to retain membership in his old group? A user can be a member of several groups at once by adding him into various lines in /etc/group. It all depends on what you really want.
And hp-ux is a little odd here, but I seem to rememeber that you use sunos.
If you want to set the default group (ie, what's in /etc/passwd) and set the supplemental group memberships (ie, what's in /etc/group), you can do something like the following:
when you do a cat /etc/group | grep (desire groupname)
you should get an output similar to this:
groupname::45:james,lola,jerry
the last names james, lola and jerry belong to the group called groupname.
my questions is, how come after using the usermod to change the group of my user, how come his name does not appear in the /etc/group as being a member of the group???
i mean if i added the user to the group called groupname, i would expect the damn username to be added right behind jerry. right???
Like Perderabo said, you are only changing your default group, and that information is on /etc/passwd on most unix systems, not on /etc/group. If you default group is "other", you wont see your userid in front of other: line on /etc/group.
Your userid will be on /etc/group if you belong to more that one group or if your user has a group for himself ( like seen on linux distributions ).