LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 12-07-2010, 11:22 AM   #1
socialdefect
LQ Newbie
 
Registered: Dec 2010
Posts: 3

Rep: Reputation: 0
How to set default user groups for new users


I am building a livecd, the live user created at boot time is a member of the audio group set in /etc/group. This way works for the livecd but when installed a user must manually add himself to the audio group. How can I set new users to automatically become a member of the audio group?
In /etc/default/useradd I can set only one group.
 
Old 12-07-2010, 01:38 PM   #2
stress_junkie
Senior Member
 
Registered: Dec 2005
Location: Massachusetts, USA
Distribution: Ubuntu 10.04 and CentOS 5.5
Posts: 3,873

Rep: Reputation: 335Reputation: 335Reputation: 335Reputation: 335
It really depends on how you are creating the user account on the installed system. If you are using useradd then you must be using a script. If you are using a script then you can designate the ancillary user groups on the command line.
Code:
useradd -G "audio,lpadmin,cdrom,whatever" useraccountname
Notice the uppercase G to designate ancillary user groups.
 
Old 12-07-2010, 02:08 PM   #3
socialdefect
LQ Newbie
 
Registered: Dec 2010
Posts: 3

Original Poster
Rep: Reputation: 0
I know I can use useradd or gpasswd afther an account is created but I'd like to set somewhere that no mather if useradd/adduser is used or the gui every new user automatically becomes a member of the group equal to the user's name and the audio group by default.
 
Old 12-07-2010, 02:38 PM   #4
stress_junkie
Senior Member
 
Registered: Dec 2005
Location: Massachusetts, USA
Distribution: Ubuntu 10.04 and CentOS 5.5
Posts: 3,873

Rep: Reputation: 335Reputation: 335Reputation: 335Reputation: 335
I misread your original post. I thought that we were talking about the user account created by the installation procedure. Now I see that this is the only case where it already works. Sorry about that.

My Ubuntu 10.04 system has a file /etc/adduser.conf. It has that kind of information in there.
 
Old 12-07-2010, 02:53 PM   #5
socialdefect
LQ Newbie
 
Registered: Dec 2010
Posts: 3

Original Poster
Rep: Reputation: 0
Thanx a lot for I never tried to change the config of useradd

I've just set the EXTRA_GROUPS variable in /etc/adduser.conf and now it works
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Lis of default users/groups? katheo Linux - Newbie 2 06-01-2006 01:48 PM
Default groups for first ubuntu user magnum81 Ubuntu 1 05-06-2006 10:27 PM
Default user groups Markup Linux - General 4 08-15-2005 04:08 AM
default groups for new users (SuSE 9.2) retiem SUSE / openSUSE 2 03-15-2005 06:35 AM
default linux users and groups mangueJOE Linux - Newbie 4 07-11-2002 09:52 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

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