Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I have a group that all users on the system share. The group name is common and it is to allow for a universal fileshare for everyone on the machine. How would I make it so that all new users are added to this group by default? [No manual intervention needed on an adduser command]

share|improve this question
    
What operating system? Remember unix.SE is about any Unix or Unix-like operating system like Solaris, HPUX, Debian/Linux, MacOS/X... Several of those have a adduser command, not all of them do. –  Stéphane Chazelas May 10 '13 at 17:08
    
Archlinux operating system –  monksy May 10 '13 at 18:24
add comment

1 Answer 1

Set ADD_EXTRA_GROUPS and EXTRA_GROUPS in /etc/adduser.conf. From the manpage:

   ADD_EXTRA_GROUPS
          Setting this to something other than 0 (the default) will  cause
          adduser  to  add  newly  created non-system users to the list of
          groups defined by EXTRA_GROUPS (below).

   EXTRA_GROUPS
          This is the list of groups that new  non-system  users  will  be
          added  to.  By default, this list is 'dialout cdrom floppy audio
          video plugdev users games'
share|improve this answer
    
Which man page are you referencing? I'm not finding this for the useradd or adduser commands. I'm on Fedora if that matters. –  slm May 10 '13 at 16:36
    
@sim, man adduser.conf –  Nykakin May 10 '13 at 16:39
    
Yeah I tried that too, don't have that on Fedora either. Is this file a Debian/Ubuntu only thing? –  slm May 10 '13 at 16:42
    
Turns out the file is called /etc/default/useradd on RHEL distros. It only contains a variable, GROUP=... where you can specify the default group you want to have added to new user accts. Untested, but you may be able to give it a list like so: GROUP=500,600,400 –  slm May 10 '13 at 16:55
    
Sorry, yeah, this is a Debian thing. –  derobert May 10 '13 at 17:42
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.