LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 10-05-2004, 12:36 AM   #1
ryancoolest
Member
 
Registered: Jan 2004
Location: Pinas
Distribution: Mandrake
Posts: 152

Rep: Reputation: 30
adding user to group


Hi Guys,

How can I add a user to a group?
Quote:
useradd user -g user -G admin
 
Old 10-05-2004, 01:00 AM   #2
jschiwal
Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654
You can either use the userdrake program as root or the gpasswd command:
gpasswd -a user group
 
Old 10-05-2004, 01:06 AM   #3
ryancoolest
Member
 
Registered: Jan 2004
Location: Pinas
Distribution: Mandrake
Posts: 152

Original Poster
Rep: Reputation: 30
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...
 
Old 10-05-2004, 01:17 AM   #4
reddazz
Guru
 
Registered: Nov 2003
Location: N. E. England
Distribution: Fedora, CentOS, Debian
Posts: 16,298

Rep: Reputation: 73
usermod userid -G group

Last edited by reddazz; 10-05-2004 at 01:18 AM.
 
Old 10-05-2004, 01:19 AM   #5
darthtux
Senior Member
 
Registered: Dec 2001
Location: 35.7480 N, 95.3690 W
Distribution: Debian, Gentoo, Red Hat, Solaris
Posts: 2,070

Rep: Reputation: 45
usermod -G group
see man usermod

For Red Hat I think it is redhat-config-users for the gui
 
Old 10-05-2004, 01:25 AM   #6
ryancoolest
Member
 
Registered: Jan 2004
Location: Pinas
Distribution: Mandrake
Posts: 152

Original Poster
Rep: Reputation: 30
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
 
Old 10-05-2004, 01:25 AM   #7
ryancoolest
Member
 
Registered: Jan 2004
Location: Pinas
Distribution: Mandrake
Posts: 152

Original Poster
Rep: Reputation: 30
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
 
Old 10-05-2004, 08:54 AM   #8
reddazz
Guru
 
Registered: Nov 2003
Location: N. E. England
Distribution: Fedora, CentOS, Debian
Posts: 16,298

Rep: Reputation: 73
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.

Last edited by reddazz; 10-05-2004 at 08:57 AM.
 
Old 10-05-2004, 08:19 PM   #9
ryancoolest
Member
 
Registered: Jan 2004
Location: Pinas
Distribution: Mandrake
Posts: 152

Original Poster
Rep: Reputation: 30
Thanks for the quick reply I will try this on my box
 
Old 04-14-2008, 12:50 PM   #10
trebek
Member
 
Registered: Feb 2005
Location: Costa Rica
Distribution: Ubuntu, gOS, Debian & Slack 12
Posts: 426

Rep: Reputation: 30
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
adding user to wheel group tied2 *BSD 10 09-28-2007 04:22 AM
Adding new group to existing user ALF Linux - Software 7 05-08-2006 09:35 PM
after adding user to group peter72 Linux - General 2 08-01-2005 10:17 AM
adding user to a group Chilipepa Linux - Newbie 2 09-27-2003 11:08 AM
Adding user account to root group konabumm Linux - Newbie 1 07-31-2003 03:11 PM


All times are GMT -5. The time now is 08:49 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration