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 ChazelasCommented May 10, 2013 at 17:08
-
Archlinux operating system– monksyCommented May 10, 2013 at 18:24
Add a comment
|
1 Answer
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'
-
Which man page are you referencing? I'm not finding this for the
useradd
oradduser
commands. I'm on Fedora if that matters.– slm ♦Commented May 10, 2013 at 16:36 -
-
1Yeah 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