Content-type: text/html Manpage of grpadmin


Section: User Commands (1)
Index Return to Main Contents


grpadmin - Manage group memberships  


grpadmin [-i] [-help] management command...  


Grpadmin is the command line interface to the Unix group database. It is used by authenticated users to make authorized changes to group memberships and ownerships. You must have existing Kerberos credentials to use grpadmin.  


Grpadmin my be invoked with the following command-line options:
Read commands from standard input.
Print out a usage message.


Group management commands may be given either as command-line arguments or typed interactively when the -i switch is used. Several commands accept a list of items; a list is single string with individual components separated by commas. Thus an example of a <user-list> would be "user1,user2,user3".

There are two classes of commands, privileged and unprivileged. Privileged commands can be run only by administrative users. Unprivileged commands may require authorization based on whether the person executing the command is the owner of or member in the group(s) specified.

grpadmin creategrp <grpname> [-grpid <number>] [-owners <user-list>] [-scope <name>] [-expire mm/dd/yy] [-gmaster <grpname>
Create a new group with the given unique name. A numeric gid will be automatically assigned unless -grpid is given. A list of initial owners may be specified. The default scope of the new group is global. If a -gmaster group is given then the new group will be a secondary to the primary in terms of owenrship and expiration date. If the group has an expiration date, all references to the group, its ownership and membership will be deleted after that date. (Privileged)
grpadmin deletegrp <grpname>
Delete a group, along with all its owners and members. (Privileged)
grpadmin addmember <grpname> -who <user-list>
Add a list of users to a group membership. (Ownership)
grpadmin delmember <grpname> -who <user-list>
Delete a list of users from a group membership and ownership. (Ownership, self-membership)
grpadmin addowner <grpname> -who <user-list>
Add a list of users as owners of a group. (Ownership)
grpadmin delowner <grpname> -who <user-list>
Remove a list of users from group ownership. (Ownership)
grpadmin deluser <user-name>
Delete a single user from all group membership and ownership. (Privileged)
grpadmin addlogin <grpname> -who <user-list>
Add a group as logingroup for the specified users. (Membership)
grpadmin dellogin <grpname> -who <user-list>
Delete a group as a logingroup for the specified users. (Membership)
grpadmin showgrps <grpname-list>
List the gids and scopes of the given groups.
grpadmin showmembers <grpname-list>
List the members of the given groups.
grpadmin showowners <grpname-list>
List the owners of the given groups.
grpadmin listugrps <user-list>
List the group memberships of the given users.
grpadmin listowned <user-list>
List the groups owned by the given users.
grpadmin renamegrp <grpname> -to <newgrpname>
Give an existing group a new name. (Ownership)
grpadmin setmaster <grpname-list> -to <grpname>
Set the primary group for each group in the name list to the given group name. <grpname> can be the empty string or "null" to break a primary-secondary relationship. (Ownership)
(Or whatever you are using as the end-of-file (EOF) character). Exit the program.


Grpadmin uses a subset of the POSIX 1003.2 regular expression syntax. Examples:
grpadmin showgrps .*
Lists all groups.
grpadmin showgrps ^t.*
List all groups that begin with 't'.
grpadmin showgrps .*59.*
List all groups that contain the string "59".

Certain metacharacters (e.g. '{',']', '$') are not allowed. Wildcarding is presently allowed only on lookup or list operations due to concerns about the "rm * .c" syndrome.

Helpful hint: If you are going to do more than one operation, use "grpadmin -i" -- it's way more efficient and you don't have to worry about \-escaping metachars to your shell.

Grpadmin produces extensive and self-explanatory error messages.  


Grpadmin and xgrpadmin are installed in the /usr/local/bin directory of research file servers and grad/faculty Linux boxes.  


xgrpadmin chgrpsh
Web interface:




This document was created by man2html, using the manual pages.
Time: 18:19:32 GMT, November 29, 2011