Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Users & groups
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
Brown Eyed Boy
Tux's lil' helper
Tux's lil' helper


Joined: 08 Jun 2003
Posts: 85
Location: England

PostPosted: Mon Jun 09, 2003 6:43 pm    Post subject: Users & groups Reply with quote

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
View user's profile Send private message
wudmx
Guru
Guru


Joined: 07 Aug 2002
Posts: 527

PostPosted: Mon Jun 09, 2003 7:45 pm    Post subject: Reply with quote

try groups username ...
this will list the groups the user belongs to!
Back to top
View user's profile Send private message
pYrania
Retired Dev
Retired Dev


Joined: 27 Oct 2002
Posts: 650
Location: Cologne - Germany

PostPosted: Mon Jun 09, 2003 7:54 pm    Post subject: Re: Users & groups Reply with quote

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?


Code:
nano -w /etc/group

_________________
Markus Nigbur
Back to top
View user's profile Send private message
iso
n00b
n00b


Joined: 06 Dec 2002
Posts: 6
Location: Sweden

PostPosted: Mon Jun 09, 2003 9:34 pm    Post subject: Better way of assigning a user to an additional group Reply with quote

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
View user's profile Send private message
Brown Eyed Boy
Tux's lil' helper
Tux's lil' helper


Joined: 08 Jun 2003
Posts: 85
Location: England

PostPosted: Tue Jun 10, 2003 3:55 pm    Post subject: Reply with quote

Cheers everyone!
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum