 |
Index for Section 8 |
|
 |
Alphabetical listing for G |
|
groupmod(8)
NAME
groupmod - Modifies a group definition on the system
SYNOPSIS
/usr/sbin/groupmod [-g gid [-o]] [-n newgroup]
[-x extended_option] group_name
/usr/sbin/groupmod -D [-x extended_option]
FLAGS
-D When used without arguments, this flag displays the system defaults for
group information. If invoked with other flags, it sets the system
defaults for the flag specified.
-g gid
Specifies a new group identification number (GID) for the group being
modified. The GID must be a non-negative decimal integer. When the -o
flag is used, the GID can be duplicated.
-n newgroup
Specifies a new name for the group. The group name can be any
printable characters, except the colon (:) and newline (\n) characters.
-o Lets a group identification (GID) number be duplicated (non-unique).
This flag can be used only with the -g flag.
-x extended_option
The following extended_option attributes are available. If you use
more than one extended_option attribute on the command line, you must
precede each attribute with the -x flag or enclose the desired
attributes in quotes.
max_gid=n
Specifies the largest numeric identifier, which may be associated
with a group. This attribute can be used only with the -D flag.
The value of the max_gid attribute must be a non-negative decimal
number.
min_gid=n
Specifies the smallest numeric identifier, which may be associated
with a group. This attribute can be used only with the -D flag.
The value of the min_gid attribute must be a non-negative decimal
number.
next_gid=n
Specifies the next available group identifier number (GID) in the
range of min_gid to max_gid. This attribute can be used only with
the -D flag. The value of the next_gid attribute must be a non-
negative decimal number.
distributed=n
Indicates that the group is distributed. The value of the
distributed=n attribute must be 0 or 1. If set to 0, the group is
maintained on the local system. If set to 1, the group is
maintained in the NIS master database on the running system.
local=n
Indicates that the group is local. The value of the local=n
attribute must be 0 or 1. If set to 1, the group is stored on a
local database. If set to 0, the group information is not stored
locally, but exists in the NIS master database.
group_name
Specifies the name of the group to be modified. The groupname must
exist.
DESCRIPTION
The groupmod command lets the system administrator modify and rename groups
on the system. In addition, the system administrator can use the -D and -x
flags on the same command line to change the maximum, minimum, and/or next
available group identifier numbers, as well as specify whether the group
account is local or resides in the NIS master database. If the -x flag is
not specified on the command line, the system modifies the group
information in the appropriate database as specified by the system
defaults.
The default behavior on the system for the groupmod command is
distributed=0 and local=1. With these values, the system modifies the
group information in the local database by default. Setting the
distributed= and local= attributes to the same value (for example,
distributed=0 and local=0) produces an error.
You must have superuser privilege to execute this command.
EXAMPLES
The following example changes the GID of the group, testgrp, to 451:
% groupmod -g 451 testgrp
The following example changes the group name of the testgrp group to
unxgrp:
% groupmod -n unxgrp testgrp
The following example changes the maximum group ID (max_gid) to 300 and the
next available group ID (next_gid) to 30:
% groupmod -D -x max_gid=300 -x next_gid=30
or
% groupmod -D -x"max_gid=300 next_gid=30"
EXIT VALUES
The groupmod command exits with one of the following values:
0 Success
2 Invalid command syntax or insufficient privilege. A usage message for
the groupmod command or an error message is displayed.
3 An invalid argument was provided to an option.
4 The GID is not unique.
7 The group does not exist.
9 The group name is not unique.
10 Cannot update the group database.
FILES
The groupmod command operates on the appropriate files for the specific
level of system security.
RELATED INFORMATION
Commands: groupadd(8), groupdel(8), useradd(8), userdel(8), usermod(8)
Documents: System Administration, Security