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 Note: This option is not recommended because the password (or
52 encrypted password) will be visible by users listing the processes.
53
54 You should make sure the password respects the system's password
55 policy.
56
57 -r, --system
58 Create a system group.
59
60 The numeric identifiers of new system groups are chosen in the
61 SYS_GID_MIN-SYS_GID_MAX range, defined in login.defs, instead of
62 GID_MIN-GID_MAX.
63
64 -R, --root CHROOT_DIR
65 Apply changes in the CHROOT_DIR directory and use the configuration
66 files from the CHROOT_DIR directory.
67
68 -P, --prefix PREFIX_DIR
69 Apply changes in the PREFIX_DIR directory and use the configuration
70 files from the PREFIX_DIR directory. This option does not chroot
71 and is intended for preparing a cross-compilation target. Some
72 limitations: NIS and LDAP users/groups are not verified. PAM
73 authentication is using the host files. No SELINUX support.
74
76 The following configuration variables in /etc/login.defs change the
77 behavior of this tool:
78
79 GID_MAX (number), GID_MIN (number)
80 Range of group IDs used for the creation of regular groups by
81 useradd, groupadd, or newusers.
82
83 The default value for GID_MIN (resp. GID_MAX) is 1000 (resp.
84 60000).
85
86 MAX_MEMBERS_PER_GROUP (number)
87 Maximum members per group entry. When the maximum is reached, a new
88 group entry (line) is started in /etc/group (with the same name,
89 same password, and same GID).
90
91 The default value is 0, meaning that there are no limits in the
92 number of members in a group.
93
94 This feature (split group) permits to limit the length of lines in
95 the group file. This is useful to make sure that lines for NIS
96 groups are not larger than 1024 characters.
97
98 If you need to enforce such limit, you can use 25.
99
100 Note: split groups may not be supported by all tools (even in the
101 Shadow toolsuite). You should not use this variable unless you
102 really need it.
103
104 SYS_GID_MAX (number), SYS_GID_MIN (number)
105 Range of group IDs used for the creation of system groups by
106 useradd, groupadd, or newusers.
107
108 The default value for SYS_GID_MIN (resp. SYS_GID_MAX) is 101
109 (resp. GID_MIN-1).
110
112 /etc/group
113 Group account information.
114
115 /etc/gshadow
116 Secure group account information.
117
118 /etc/login.defs
119 Shadow password suite configuration.
120
122 Groupnames may contain only lower and upper case letters, digits,
123 underscores, or dashes. They can end with a dollar sign. Dashes are not
124 allowed at the beginning of the groupname. Fully numeric groupnames and
125 groupnames . or .. are also disallowed. In regular expression terms:
126 [a-zA-Z0-9_.][a-zA-Z0-9_.-]*[$]?
127
128 Groupnames may only be up to 32 characters long.
129
130 You may not add a NIS or LDAP group. This must be performed on the
131 corresponding server.
132
133 If the groupname already exists in an external group database such as
134 NIS or LDAP, groupadd will deny the group creation request.
135
137 The groupadd command exits with the following values:
138
139 0
140 success
141
142 2
143 invalid command syntax
144
145 3
146 invalid argument to option
147
148 4
149 GID not unique (when -o not used)
150
151 9
152 group name not unique
153
154 10
155 can't update group file
156
158 chfn(1), chsh(1), passwd(1), gpasswd(8), groupdel(8), groupmod(8),
159 login.defs(5), useradd(8), userdel(8), usermod(8).
160
161
162
163shadow-utils 4.6 11/08/2018 GROUPADD(8)