Managing User Accounts and User Environments in Oracle® Solaris 11.2

Exit Print View

Updated: September 2014
 
 

How to Add a Group

When an administrator creates a group, the system assigns the solaris.group.assign/groupname to that administrator, giving the administrator complete control over that group. If another administrator who has the same authorization creates a group, that administrator has the control over that group. An administrator who has control of one group cannot administer the group of the other administrator. For more information, see the groupadd (1M) and groupmod (1M) man pages.

  1. Assume the root role or an administrator who has the solaris.group.manage authorization.

    See Using Your Assigned Administrative Rights in Securing Users and Processes in Oracle Solaris 11.2 .

  2. List the existing groups.
    # cat /etc/group
  3. Create a new group.
    $ groupadd -g group-id group-name
    groupadd

    Creates a new group definition on the system by adding the appropriate entry to the /etc/group file.

    –g

    Assigns the group ID for the new group.

    For more information, see the groupadd (1M) man page.

Example 2-2  Setting Up a Group and User With the groupadd and useradd Commands

The following example shows how to use the groupadd and useradd commands to add the group scutters and the user scutter1 to files on the local system.

# groupadd -g 102 scutters
# useradd -u 1003 -g 102 -d /export/home/scutter1 -s /bin/csh \
-c "Scutter 1" -m -k /etc/skel scutter1
64 blocks

For more information, see the groupadd (1M) and useradd (1M) man pages.