Default user groups

Rick Stevens ricks at nerd.com
Thu Feb 10 22:35:30 UTC 2011


On 02/10/2011 12:35 PM, Chris Smart wrote:
> On Fri, Feb 11, 2011 at 6:18 AM, g<geleem at bellsouth.net>  wrote:
> hey g
>>
>> consider /etc/default/useradd;
>>
>> Â # useradd defaults file
>> Â GROUP=100,20,63,1010,2020
>
> Thanks, but I actually tried this and it didn't work because it treats
> them as a single group, "100,20,63.." and doesn't separate them :-(

/etc/default/useradd contains the values used to fill out the "useradd"
command if you don't put in the options, but it doesn't supply anything
for the "-G|--groups" option of useradd.  You still need to add that
option to the command.

You could alias useradd:

	alias myuseradd="useradd -G 20,63,1010,2020"

then when you use "myuseradd", the user added will have the specified
supplemental groups added to him/her.
----------------------------------------------------------------------
- Rick Stevens, Systems Engineer, C2 Hosting          ricks at nerd.com -
- AIM/Skype: therps2        ICQ: 22643734            Yahoo: origrps2 -
-                                                                    -
-  Memory is the second thing to go, but I can't remember the first! -
----------------------------------------------------------------------


More information about the users mailing list