DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 

groupadd(ADM)


groupadd, groupdel, groupmod -- add, delete, or change a group account

Syntax

/etc/groupadd [-g gid [-o]] [-x "extendedOptionString"] [-X optionsFile] group_name

/etc/groupdel group_name

/etc/groupmod [-g gid [-n group_name] [-o]] [-x "extendedOptionString"]
[-X optionsFile] group_name

/etc/groupmod -D [-x "extendedOptionString"] [-X optionsFile]

Description

With no options specified, groupadd creates the specified group account on the local system.

Groups can be created in one of three locations:

If a group already exists locally when an NIS version of that group is created, the local group is removed from the system. If an NIS version of a group already exists when a local version is created, the remote group is not deleted. If you wish to delete the remote group, you must do so before adding the local group of the same name.

groupdel deletes a group account from the Group Account database.

groupmod modifies one or more of the attributes associated with the specified group account.

group_names have these limitations:

Options

The following options are supported by groupadd and groupmod:

-g gid
Specify the group ID (new or revised). It must be a non-negative integer less than 60000. The minimum and maximum values are defined in /etc/default/accounts.

-o
Allow the use of a GID already assigned to another account. This option is only valid when the Low or Traditional security profile is configured (specifically, REUSEUID=TRUE must be present in /etc/default/login).
The following options are supported by groupmod only:

-n group_name
Rename the specified group to group_name.

-D
Modify the specified system default attribute.
The following options are supported by groupadd, groupdel, and groupmod:

-x "extendedOptionString"
Specify extended account attributes. See ``Extended options and option files''.

-X optionsFile
Specify the file from which the group attributes are to be taken.

Extended options and option files

Extended options use the following syntax:

{ attribute value }

Attributes associated with a set of values should enclose the values in nested braces:

{ attribute { value value } }

When used on the command line, the outermost braces ({ }) must be enclosed in double-quotes (") to prevent interpretation by the shell. Values containing spaces should be further enclosed in single quotes (').

Option files use the same syntax (minus the double-quotes).

There are two groups of attributes: individual (ones that can be set only for individuals, such as group name) and system defaults (such as largest possible GID). System default attributes require the use of the -D option.

The following attribute is defined for both individuals and system defaults (and so is valid with or without the -D option):


distributed
If defined, the group is distributed via NIS (NIS must be configured for accounts to be distributed).

The following individual attributes are defined (not valid with -D option):

gr_gid
The numeric group identifier.

gr_mem
The list of accounts who are a members of a group.

gr_name
The unique name that identifies a group.
These attributes are system defaults (valid with -D):

maxGid
The largest numeric identifier assigned to a new group (must be less than 60000).

maxSuggestGid
The largest numeric identifier assigned to a new group by default (must be less than or equal to maxGid).

minGid
The smallest numeric identifier assigned to a new group (must be greater than or equal to 0).

minSuggestGid
The smallest numeric identifier assigned to a new group by default (must be greater than or equal to 0 and greater than or equal to minGid).

nextGid
The next available pw_uid in the range of minGid to maxGid.

Exit values

Upon completion, these utilities exit with one of the following values:

0
The action was successful.

>0
An error occurred.

Files


/etc/group
group file

/etc/group.local
local group file for NIS servers

/etc/group.yp
distributed group file for NIS servers

/etc/auth/?/*
Subsystem Authorizations database

/etc/default/accounts
user/group account creation defaults

See also

groupls(ADM), userls(ADM), useradd(ADM)

Standards conformance

groupadd is conformant with AT&T SVID Issue 2.
© 2005 The SCO Group, Inc. All rights reserved.
SCO OpenServer Release 6.0.0 -- 03 June 2005