Next | Prev | Up | Top | Contents | Index

Group ID Numbers

Each user account belongs to a group of users on the system. Users with similar interests or jobs can belong to the same group. For example, members of the publications department might belong to group pub. The benefit to this arrangement is that it allows groups of related users to share files and resources without sharing those files or resources with the entire system community.

Each group has a group ID number. These numbers are unique on each system and should be unique throughout the entire site. Like user IDs, you should not reuse group IDs.

When you create a file, it is assigned your group ID. You can change the group ID of a file with the chgrp(1) command. By manipulating the permissions field of the file, the owner (or someone with the effective user-ID of the owner) can grant read, write, or execute privileges to other group members.

Information about groups is kept in the /etc/group file. A sample entry from this file is shown and explained below:

raccoons::101:norton,ralph

Each entry is one line; each line has the following fields:

group name

The group name can be any length, though some commands will truncate the name to 8 characters. The first character must be alphabetic.

password

The password field may contain an encrypted password. An empty field, as in the above example, indicates that no password is required. The passwd(1M) command cannot be used to create or modify a group password. To place a password on a group, you must use the passwd command to encrypt a password. (Use a test user account created specifically for this purpose and then delete the test account.) Then, copy that encrypted password verbatim from the /etc/passwd file into the /etc/group entry you wish to protect with the password. Users specifically listed as group members in the /etc/group file entry will not be required to give the password, but other users will be so required when they attempt to change groups to the protected group with the newgrp(1) command. Password protection, though, is rarely used on user groups.

group ID

The group ID is a number from 0 to 60,000. The number must not include a comma. Numbers below 100 are reserved for system accounts.

login names

The login names of group members are in a comma-separated list.
For complete information on user groups, see the group(4) reference page.


Next | Prev | Up | Top | Contents | Index