1GROUPADD(8)               System Management Commands               GROUPADD(8)
2
3
4

NAME

6       groupadd - create a new group
7

SYNOPSIS

9       groupadd [options] group
10

DESCRIPTION

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

OPTIONS

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

CONFIGURATION

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

FILES

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

CAVEATS

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.
126
127       Groupnames may only be up to 32 characters long.
128
129       You may not add a NIS or LDAP group. This must be performed on the
130       corresponding server.
131
132       If the groupname already exists in an external group database such as
133       NIS or LDAP, groupadd will deny the group creation request.
134

EXIT VALUES

136       The groupadd command exits with the following values:
137
138       0
139           success
140
141       2
142           invalid command syntax
143
144       3
145           invalid argument to option
146
147       4
148           GID is already used (when called without -o)
149
150       9
151           group name is already used
152
153       10
154           can't update group file
155

SEE ALSO

157       chfn(1), chsh(1), passwd(1), gpasswd(8), groupdel(8), groupmod(8),
158       login.defs(5), useradd(8), userdel(8), usermod(8).
159
160
161
162shadow-utils 4.8.1                03/24/2020                       GROUPADD(8)
Impressum