Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
More options
HP.com home
HP-UX Reference > G

groupmod(1M)

HP-UX 11i Version 3: February 2007
» 

Technical documentation

» Feedback
Content starts here

 » Table of Contents

 » Index

NAME

groupmod — modify a group on the system

SYNOPSIS

groupmod [-S alternate_password_file] [-g gid [-o]] [-n name] [[-a|-m|-d ]-l userlist] group

DESCRIPTION

The groupmod command modifies a group on the system by altering the appropriate entry in the /etc/group file.

The groupmod command must be used with the group argument, which is the name of the group to be modified. The name consists of a string of printable characters that may not include a colon (:) or newline (\n).

Options

The groupmod command uses the following options:

-S alternate_password_file

Specify the path to the alternate password file. When this option is specified, user information is looked up in this file, instead of /etc/passwd.

If specified, the -S option should used as the first option.

-g gid

Change the value of the group ID to gid. gid must be a non-negative decimal integer less than MAXUID as defined in the <param.h> header file.

-o

Allow the gid to be non-unique (that is, a duplicate).

-n name

Change the name of the group to name. name consists of a string of printable characters that may not include a colon (:) or newline (\n).

-a

Add userlist to the supplementary group membership list of group. It should be used in conjunction with -l option.

-m

Modify the supplementary group membership list of group to userlist. It should be used in conjunction with -l option.

-d

Delete userlist from the supplementary group membership list of group. It should be used in conjunction with -l option.

-l

Specifies the list of users for modifying the supplementary group membership list of the group. When options -a, -m, and -d options are not specified, -m is assumed.

NIS

The groupmod command is aware of NIS user entries. Only local groups may be modified with groupmod. Attempts to modify an NIS group will result in an error. NIS groups must be administered from the NIS server. If groupmod is used on a system where NIS is installed, it may fail with the error

group x does not exist

(return value 6) if the group specified is an NIS group (see group(4)). However, NIS groups are checked when verifying uniqueness of the new gid or new group name, which may result in the above error, or the error

GID # is not unique

(return value 4).

RETURN VALUE

The groupmod command exits with one of the following values:

0

No error.

2

Invalid command syntax.

3

Invalid argument supplied to an option.

4

gid is not unique (when -o is not used).

6

group does not exist.

9

group is not unique.

10

Cannot modify the /etc/group file.

11

/etc/passwd file or /etc/ptmp file busy. Another command may be modifying the /etc/passwd file.

12

Unable to open /etc/ptmp file or the /etc/passwd file is non-existent.

20

Exceeding permissible limit of maximum members in a group. The /etc/group file is not modified.

EXAMPLES

Change the group ID of the group project2 to 111 in the file /etc/group if the group project2 exists. This is done even if the group ID 111 is already in use.

groupmod -g 111 -o project2

Change the name of project2 to project22 in the file /etc/group if the group project22 does not already exist.

groupmod -n project22 project2

WARNINGS

Because many users try to write to the /etc/passwd file simultaneously, a password locking mechanism was devised. If this locking fails after subsequent retrying, groupmod terminates.

FILES

/etc/group /etc/ptmp

STANDARDS CONFORMANCE

groupmod: SVID3

Printable version
Privacy statement Using this site means you accept its terms Feedback to webmaster
© 1983-2007 Hewlett-Packard Development Company, L.P.