COHERENT manpages
This page displays the COHERENT manpage for group [Define groups of users].
List of available manpages
Index
group -- System Administration
Define groups of users
The group file /etc/group describes the user groups that have been defined
on your COHERENT system. This allows users to control the access that
members of their group have to certain files. /etc/group contains the
information to map any ASCII group name to the corresponding numerical
group identifier, and vice versa. It also contains, in ASCII, the names of
the members of each group. This information is used by, among others, the
command newgrp.
Each group has an entry in the file /etc/group one line per entry. Each
line consists of four colon-separated ASCII fields, as follows:
group_name : password : group_number : member[,member...]
Passwords are encrypted with crypt, so the group file is generally
readable.
The COHERENT system has five system calls that manipulate /etc/group, as
follows:
endgrent()
Close /etc/group.
getgrent()
Return the next entry from /etc/group.
getgrnam()
Return the first entry with a given group name.
getgrgid()
Return the first entry with a given group identifier.
setgrent()
Rewind /etc/group, so that searches can begin again from the
beginning of the file.
The calls getgrent(), getgrid(), and getgrnam() each return a pointer to
structure group, which the header file grp.h defines as follows:
struct group {
char *gr_name; /* Group name */
char *gr_passwd;/* Group password */
int gr_gid; /* Numeric group id */
char **gr_mem; /* Group members */
};
A user can belong to more than one group. His ``main'' group, however, is
the one that is named is in his entry in the file /etc/passwd. When a user
creates a file, that file by default is ``owned'' by the user's main group.
For example, consider user joe, who has the following entry in /etc/passwd:
joe:*:10:5:Joe Smith:/usr/joe:/usr/bin/ksh
The fourth field, which in this example has the value 5, gives the number
of the user's main group. (For details on what the other fields mean, see
the Lexicon entry for passwd.) Looking in /etc/group, we see the following
entry for group 5:
user::5:
Thus, whenever joe creates a file, by default it will be ``owned'' by group
user. Any member of group user will be granted that file's group-level
permissions on that file.
A user can use the command chmod to change the group-level permissions on
any file he owns. The superuser root can use the command chgrp to changes
the group ownership for any file. For details on how to use these
commands, see their entries in the Lexicon.
Files
/etc/group
See Also
Administering COHERENT,
chgrp(),
chmod,
chown,
endgrent(),
getgrent(),
getgrgid(),
getgrnam(),
grp.h,
newgrp,
passwd,
setgrend()
Notes
At present the group password field cannot be set directly (no command
similar to passwd exists for groups). One alternative is to set the
password in the /etc/passwd file for a user with the passwd command, then
transcribe the password into the group file manually.






