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

NAME

6       groupmod - modify a group definition on the system
7

SYNOPSIS

9       groupmod [options] GROUP
10

DESCRIPTION

12       The groupmod command modifies the definition of the specified GROUP by
13       modifying the appropriate entry in the group database.
14

OPTIONS

16       The options which apply to the groupmod command are:
17
18       -a, --append GID
19           If group members are specified with -U, append them to the existing
20           member list, rather than replacing it.
21
22       -g, --gid GID
23           The group ID of the given GROUP will be changed to GID.
24
25           The value of GID must be a non-negative decimal integer. This value
26           must be unique, unless the -o option is used.
27
28           Users who use the group as primary group will be updated to keep
29           the group as their primary group.
30
31           Any files that have the old group ID and must continue to belong to
32           GROUP, must have their group ID changed manually.
33
34           No checks will be performed with regard to the GID_MIN, GID_MAX,
35           SYS_GID_MIN, or SYS_GID_MAX from /etc/login.defs.
36
37       -h, --help
38           Display help message and exit.
39
40       -n, --new-name NEW_GROUP
41           The name of the group will be changed from GROUP to NEW_GROUP name.
42
43       -o, --non-unique
44           When used with the -g option, allow to change the group GID to a
45           non-unique value.
46
47       -p, --password PASSWORD
48           The encrypted password, as returned by crypt(3).
49
50           Note: This option is not recommended because the password (or
51           encrypted password) will be visible by users listing the processes.
52
53           You should make sure the password respects the system's password
54           policy.
55
56       -R, --root CHROOT_DIR
57           Apply changes in the CHROOT_DIR directory and use the configuration
58           files from the CHROOT_DIR directory. Only absolute paths are
59           supported.
60
61       -P, --prefix PREFIX_DIR
62           Apply changes in the PREFIX_DIR directory and use the configuration
63           files from the PREFIX_DIR directory. This option does not chroot
64           and is intended for preparing a cross-compilation target. Some
65           limitations: NIS and LDAP users/groups are not verified. PAM
66           authentication is using the host files. No SELINUX support.
67
68       -U, --users
69           A list of usernames to add as members of the group.
70
71           The default behavior (if the -g, -N, and -U options are not
72           specified) is defined by the USERGROUPS_ENAB variable in
73           /etc/login.defs.
74

CONFIGURATION

76       The following configuration variables in /etc/login.defs change the
77       behavior of this tool:
78
79       MAX_MEMBERS_PER_GROUP (number)
80           Maximum members per group entry. When the maximum is reached, a new
81           group entry (line) is started in /etc/group (with the same name,
82           same password, and same GID).
83
84           The default value is 0, meaning that there are no limits in the
85           number of members in a group.
86
87           This feature (split group) permits to limit the length of lines in
88           the group file. This is useful to make sure that lines for NIS
89           groups are not larger than 1024 characters.
90
91           If you need to enforce such limit, you can use 25.
92
93           Note: split groups may not be supported by all tools (even in the
94           Shadow toolsuite). You should not use this variable unless you
95           really need it.
96

FILES

98       /etc/group
99           Group account information.
100
101       /etc/gshadow
102           Secure group account information.
103
104       /etc/login.defs
105           Shadow password suite configuration.
106
107       /etc/passwd
108           User account information.
109

EXIT VALUES

111       The groupmod command exits with the following values:
112
113       0
114           E_SUCCESS: success
115
116       2
117           E_USAGE: invalid command syntax
118
119       3
120           E_BAD_ARG: invalid argument to option
121
122       4
123           E_GID_IN_USE: group id already in use
124
125       6
126           E_NOTFOUND: specified group doesn't exist
127
128       9
129           E_NAME_IN_USE: group name already in use
130
131       10
132           E_GRP_UPDATE: can't update group file
133
134       11
135           E_CLEANUP_SERVICE: can't setup cleanup service
136
137       12
138           E_PAM_USERNAME: can't determine your username for use with pam
139
140       13
141           E_PAM_ERROR: pam returned an error, see syslog facility id groupmod
142           for the PAM error message
143

SEE ALSO

145       chfn(1), chsh(1), passwd(1), gpasswd(8), groupadd(8), groupdel(8),
146       login.defs(5), useradd(8), userdel(8), usermod(8).
147
148
149
150shadow-utils 4.13                 03/06/2023                       GROUPMOD(8)
Impressum