The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Adding user to a group without SAM paqman HP-UX 2 08-15-2007 04:05 AM
Adding quota for a group manoranjan UNIX for Advanced & Expert Users 1 12-21-2006 01:35 PM
Adding users to /etc/group golfhakker UNIX for Dummies Questions & Answers 1 03-30-2006 01:27 PM
Adding root user to a group The Specialist UNIX for Dummies Questions & Answers 7 10-28-2005 07:09 PM
Adding an extension to a group of filenames pepintheshort UNIX for Dummies Questions & Answers 9 04-09-2004 05:11 PM

Closed Thread
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 11-13-2003
Registered User
 

Join Date: Jan 2002
Posts: 144
Adding a user to a group

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???

am i doing something wrong here???
Forum Sponsor
  #2  
Old 11-13-2003
Perderabo's Avatar
Unix Daemon
 

Join Date: Aug 2001
Location: Washington DC Area
Posts: 8,667
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.
  #3  
Old 11-13-2003
kduffin's Avatar
UN1X
 

Join Date: Nov 2003
Location: Virginia
Posts: 441
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:

usermod -g users -G apps,sysadmin kduffin

Cheers,

Keith

Last edited by kduffin; 11-17-2003 at 07:42 PM.
  #4  
Old 11-14-2003
Registered User
 

Join Date: Jan 2002
Posts: 144
what am saying is this

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???
  #5  
Old 11-14-2003
jsilva's Avatar
Registered User
 

Join Date: Apr 2003
Posts: 169
Hi,

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 ).
  #6  
Old 11-14-2003
Registered User
 

Join Date: Sep 2002
Location: Nashville, TN
Posts: 66
Why don't you just go into /etc/passwd and /etc/group to make the changes you want?
Google The UNIX and Linux Forums
Closed Thread

Tags
linux

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 08:52 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0