5

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]

2
  • 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. Commented May 10, 2013 at 17:08
  • Archlinux operating system
    – monksy
    Commented May 10, 2013 at 18:24

1 Answer 1

4

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'
5
  • 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
    Commented May 10, 2013 at 16:36
  • @sim, man adduser.conf
    – Nykakin
    Commented May 10, 2013 at 16:39
  • 1
    Yeah I tried that too, don't have that on Fedora either. Is this file a Debian/Ubuntu only thing?
    – slm
    Commented May 10, 2013 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
    Commented May 10, 2013 at 16:55
  • 1
    Sorry, yeah, this is a Debian thing.
    – derobert
    Commented May 10, 2013 at 17:42

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .