Next | Prev | Up | Top | Contents | Index

Adding User Groups Using Shell Commands

Follow these steps to add a group to the system manually:

  1. Log in as root.

  2. Edit the file /etc/group. The file contains a list of groups on the system, one group per line. Each line contains the name of the group, an optional password, the group ID number, and the user accounts who belong to that group.

    For example, to create a group called raccoons, with a group ID of 103, place this line at the end of the file:

    raccoons:*:103:

  3. If there are users who should belong to the group, add their names in the last field. Each name should be separated by a comma, for example:

    raccoons:*:103:ralph,norton

  4. Write and exit the file. Make sure the group IDs in the file /etc/passwd file match those in the /etc/group file.
For more information on user groups, see the group(4) reference page.


Next | Prev | Up | Top | Contents | Index