LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   adding user to group (https://www.linuxquestions.org/questions/linux-newbie-8/adding-user-to-group-238904/)

ryancoolest 10-05-2004 12:36 AM

adding user to group
 
Hi Guys,

How can I add a user to a group?
Quote:

useradd user -g user -G admin

jschiwal 10-05-2004 01:00 AM

You can either use the userdrake program as root or the gpasswd command:
gpasswd -a user group

ryancoolest 10-05-2004 01:06 AM

Quote:

Originally posted by jschiwal
You can either use the userdrake program as root or the gpasswd command:
gpasswd -a user group

My 2nd box is not mandrake its redhat...

reddazz 10-05-2004 01:17 AM

usermod userid -G group

darthtux 10-05-2004 01:19 AM

usermod -G group
see man usermod

For Red Hat I think it is redhat-config-users for the gui

ryancoolest 10-05-2004 01:25 AM

Quote:

Originally posted by reddazz
usermod userid -G group
Oks. I'll try this command... How can I confirm that user has been added to the group?

Thanks

ryancoolest 10-05-2004 01:25 AM

Quote:

Originally posted by darthtux
usermod -G group
see man usermod

For Red Hat I think it is redhat-config-users for the gui

Oks... try this one also... thanks

reddazz 10-05-2004 08:54 AM

the command is actually
usermod -G groupname userid

to check if the person is in the group you can do,

cat /etc/group
or
cat /etc/group | more

a list of groups and their corresponding users will be shown. There are probably other ways to do it, but I find this quite fast.

ryancoolest 10-05-2004 08:19 PM

Thanks for the quick reply I will try this on my box

trebek 04-14-2008 12:50 PM

If you perform id user_name, i think it'll list, at the end, all the groups the user belongs to. You can try that too.


All times are GMT -5. The time now is 02:06 PM.