LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices

Reply
 
Search this Thread
Old 05-29-2006, 10:33 PM   #1
levis_inferno
LQ Newbie
 
Registered: May 2006
Posts: 11

Rep: Reputation: 0
create user with secondary group


i just learn linux, i want to ask how to create an user with more than 1 secondary group?
thank for response
 
Old 05-29-2006, 10:43 PM   #2
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,123

Rep: Reputation: 162Reputation: 162
Are you using the useradd command to create your users? If so, the -G switch is for specifying secondary groups. For example:
Code:
useradd -c "User Full Name" -g primarygroup -G secondgroup,thirdgroup -s /bin/bash username
Have a look at the man page for useradd for more info; man useradd
 
Old 05-29-2006, 11:22 PM   #3
levis_inferno
LQ Newbie
 
Registered: May 2006
Posts: 11

Original Poster
Rep: Reputation: 0
if the question is create user jack with secondary group manager, sysadmin, admin and web dev could i use this command:
useradd -c jack -G manager,sysadmin,admin, webdev -s /bin/bash jack
 
Old 05-29-2006, 11:24 PM   #4
levis_inferno
LQ Newbie
 
Registered: May 2006
Posts: 11

Original Poster
Rep: Reputation: 0
if the question is create user "jack" with secondary group manager, admin, sysadmin,webdev can i use this command:
useradd jack -G manager, admin, sysadmin, webdev -s /bin/bash jack

regard
levis
 
Old 05-30-2006, 01:34 AM   #5
winxandlinx
Member
 
Registered: May 2006
Posts: 141

Rep: Reputation: 15
can you explain me what is creating user with secondary group
 
Old 05-30-2006, 03:26 PM   #6
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,123

Rep: Reputation: 162Reputation: 162
Normally when you create a user they are also added to a group (their primary group) with the -g switch.

Secondary or supplementary groups are often used so that multiple users can access the same directories. They can also be used to provide access to devices (sound cards, cdroms, etc.).

For example, my home directory is owned by my user account and my primary group - there are no other members of the group that owns my home directory. However, I am also in a developers group (a secondary group) so that I can access the documentation the developers in my area use.
 
Old 05-31-2006, 01:33 AM   #7
winxandlinx
Member
 
Registered: May 2006
Posts: 141

Rep: Reputation: 15
Thanks for your clarification
 
  


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
User and Group Admin: How to tell Who is in What group? Akhran Linux - Newbie 1 11-13-2005 12:16 AM
can i create a user group at this site? asahlot LQ Suggestions & Feedback 1 10-13-2005 04:08 PM
Secondary User Sound aeuzent Ubuntu 1 09-10-2005 03:56 PM
create user/group in cmd line rgiggs Mandriva 3 04-12-2004 10:46 PM
Primary and secondary group trophy Linux - Newbie 2 04-03-2004 01:30 AM


All times are GMT -5. The time now is 08:51 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