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]

  • 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

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

          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).

          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'
| 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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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