1GROUPADD(8) System Management Commands GROUPADD(8)
2
3
4
6 groupadd - create a new group
7
9 groupadd [options] group
10
12 The groupadd command creates a new group account using the values
13 specified on the command line plus the default values from the system.
14 The new group will be entered into the system files as needed.
15
17 The options which apply to the groupadd command are:
18
19 -f, --force
20 This option causes the command to simply exit with success status
21 if the specified group already exists. When used with -g, and the
22 specified GID already exists, another (unique) GID is chosen (i.e.
23 -g is turned off).
24
25 -g, --gid GID
26 The numerical value of the group´s ID. This value must be unique,
27 unless the -o option is used. The value must be non-negative. The
28 default is to use the smallest ID value greater than or equal to
29 GID_MIN and greater than every other group.
30
31 See also the -r option and the GID_MAX description.
32
33 -h, --help
34 Display help message and exit.
35
36 -K, --key KEY=VALUE
37 Overrides /etc/login.defs defaults (GID_MIN, GID_MAX and others).
38 Multiple -K options can be specified.
39
40 Example: -K GID_MIN=100 -K GID_MAX=499
41
42 Note: -K GID_MIN=10,GID_MAX=499 doesn´t work yet.
43
44 -o, --non-unique
45 This option permits to add a group with a non-unique GID.
46
47 -p, --password PASSWORD
48 The encrypted password, as returned by crypt(3). The default is to
49 disable the password.
50
51
52 Note: This option is not recommended because the password (or
53 encrypted password) will be visible by users listing the processes.
54
55 You should make sure the password respects the system´s password
56 policy.
57
58 -r, --system
59 Create a system group.
60
61 The numeric identifiers of new system groups are chosen in the
62 SYS_GID_MIN-SYS_GID_MAX range, defined in login.defs, instead of
63 GID_MIN-GID_MAX.
64
65 -R, --root CHROOT_DIR
66 Apply changes in the CHROOT_DIR directory and use the configuration
67 files from the CHROOT_DIR directory.
68
70 The following configuration variables in /etc/login.defs change the
71 behavior of this tool:
72
73 GID_MAX (number), GID_MIN (number)
74 Range of group IDs used for the creation of regular groups by
75 useradd, groupadd, or newusers.
76
77 The default value for GID_MIN (resp. GID_MAX) is 500 (resp.
78 60000).
79
80 MAX_MEMBERS_PER_GROUP (number)
81 Maximum members per group entry. When the maximum is reached, a new
82 group entry (line) is started in /etc/group (with the same name,
83 same password, and same GID).
84
85 The default value is 0, meaning that there are no limits in the
86 number of members in a group.
87
88 This feature (split group) permits to limit the length of lines in
89 the group file. This is useful to make sure that lines for NIS
90 groups are not larger than 1024 characters.
91
92 If you need to enforce such limit, you can use 25.
93
94 Note: split groups may not be supported by all tools (even in the
95 Shadow toolsuite). You should not use this variable unless you
96 really need it.
97
98 SYS_GID_MAX (number), SYS_GID_MIN (number)
99 Range of group IDs used for the creation of system groups by
100 useradd, groupadd, or newusers.
101
102 The default value for SYS_GID_MIN (resp. SYS_GID_MAX) is 201
103 (resp. GID_MIN-1).
104
106 /etc/group
107 Group account information.
108
109 /etc/gshadow
110 Secure group account information.
111
112 /etc/login.defs
113 Shadow password suite configuration.
114
116 Groupnames may only be up to 32 characters long.
117
118 You may not add a NIS or LDAP group. This must be performed on the
119 corresponding server.
120
121 If the groupname already exists in an external group database such as
122 NIS or LDAP, groupadd will deny the group creation request.
123
125 The groupadd command exits with the following values:
126
127 0
128 success
129
130 2
131 invalid command syntax
132
133 3
134 invalid argument to option
135
136 4
137 GID not unique (when -o not used)
138
139 9
140 group name not unique
141
142 10
143 can´t update group file
144
146 chfn(1), chsh(1), passwd(1), gpasswd(8), groupdel(8), groupmod(8),
147 login.defs(5), useradd(8), userdel(8), usermod(8).
148
149
150
151shadow-utils 4.1.5.1 05/10/2016 GROUPADD(8)