View previous topic :: View next topic |
Author |
Message |
Brown Eyed Boy Tux's lil' helper
Joined: 08 Jun 2003 Posts: 85 Location: England
|
Posted: Mon Jun 09, 2003 6:43 pm Post subject: Users & groups |
|
|
Hi. What command(s) do I use or where do I look to find out what groups a user belongs to?
Also, is there a better way of assigning a user to an additional group than "usermod -G x,y,z username" and having to list all groups he/she already belongs to in addition to the group(s) I want to add?
Thanks. |
|
Back to top |
|
|
wudmx Guru
Joined: 07 Aug 2002 Posts: 527
|
Posted: Mon Jun 09, 2003 7:45 pm Post subject: |
|
|
try groups username ...
this will list the groups the user belongs to! |
|
Back to top |
|
|
pYrania Retired Dev
Joined: 27 Oct 2002 Posts: 650 Location: Cologne - Germany
|
Posted: Mon Jun 09, 2003 7:54 pm Post subject: Re: Users & groups |
|
|
Quote: |
Also, is there a better way of assigning a user to an additional group than "usermod -G x,y,z username" and having to list all groups he/she already belongs to in addition to the group(s) I want to add?
|
_________________ Markus Nigbur |
|
Back to top |
|
|
iso n00b
Joined: 06 Dec 2002 Posts: 6 Location: Sweden
|
Posted: Mon Jun 09, 2003 9:34 pm Post subject: Better way of assigning a user to an additional group |
|
|
Brown Eyed Boy wrote: | Also, is there a better way of assigning a user to an additional group than "usermod -G x,y,z username" and having to list all groups he/she already belongs to in addition to the group(s) I want to add?
Thanks. |
I have also wondered about this. It seems to be very common for linux administrators to modify the /etc/group file directly to define group belongings. For me (at least) it feels safer to use a program designed for this specific task (so you don't mess up the group file). Thanks for making me find the command again! Try this:
Code: | gpasswd -a username groupname
gpasswd -d username groupname
|
which (in order) adds respectively deletes an user from a group.
Hope it helps you out. |
|
Back to top |
|
|
Brown Eyed Boy Tux's lil' helper
Joined: 08 Jun 2003 Posts: 85 Location: England
|
Posted: Tue Jun 10, 2003 3:55 pm Post subject: |
|
|
Cheers everyone! |
|
Back to top |
|
|
|