LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
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
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
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
LQ Guru
 
Registered: Nov 2003
Location: N. E. England
Distribution: Fedora, CentOS, Debian
Posts: 16,298

Rep: Reputation: 77
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: 47
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
LQ Guru
 
Registered: Nov 2003
Location: N. E. England
Distribution: Fedora, CentOS, Debian
Posts: 16,298

Rep: Reputation: 77
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



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

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:00 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration