 |
Index for Section 8 |
|
 |
Alphabetical listing for G |
|
groupadd(8)
NAME
groupadd - Adds a new group definition
SYNOPSIS
/usr/sbin/groupadd [-g gid [-o]] [-x extended_option] group_name
FLAGS
-g gid
Specifies the group identifier (GID) of the new group being added. The
GID must be a non-negative decimal integer.
-o Allows a group identification (GID) number to be duplicated (non-
unique). This flag can be used only with the -g flag.
-x extended_option
The following extended_option attributes are available:
distributed=n
Indicates that the group is distributed. The value of the
distributed=n attribute can be 0 or 1. If set to 0, the group is
added to the local system. If set to 1, the group is added to the
NIS master database on the running system.
local=n
Indicates that the group is local. The value of the local=n
attribute can be 0 or 1. If set to 1, the group is added to the
local database. If set to 0, the group information is added to the
NIS master database.
group_name
Specifies the name of the new group. The group name can be any
printable characters, with the exception of the colon (:) and newline
(\n) characters.
DESCRIPTION
The groupadd command lets the system administrator create new groups on the
system, by specifying the group name and GID. When the GID is not
specified (with the -g flag), the GID defaults to the next available
(unique) number.
The -x flag lets the system administrator specify whether the new group is
local or distributed over a network. If this flag is not specified on the
command line, the system adds the new group to the appropriate database as
specified by the system defaults.
The default behavior on the system for the groupadd command is
distributed=0 and local=1. With these values, the system adds the group to
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 adds the group, newgroup, to the group database with
a system-provided GID:
% groupadd newgroup
The following example adds the group, newgroup, to the group database with
a GID of 451:
% groupadd -g 451 newgroup
The following example adds the group, newgroup, to the NIS master database:
% groupadd -x distributed=1 newgroup
EXIT VALUES
The groupadd command exits with one of the following values:
0 Success
2 Invalid command syntax or insufficient privilege. A usage message for
the groupadd command or an error message is displayed.
3 An invalid argument was provided to an option.
4 The GID is not unique.
5 The GID is invalid.
9 The group name is not unique.
10 Cannot update the group database.
FILES
The groupadd command operates on files for the specific level of system
security.
RELATED INFORMATION
Commands: groupdel(8), groupmod(8), useradd(8), userdel(8), usermod(8)
Documents: System Administration, Security