xref: /openbsd/share/man/man5/group.5 (revision 78b63d65)
1.\"	$OpenBSD: group.5,v 1.7 2000/10/26 00:37:04 aaron Exp $
2.\"	$NetBSD: group.5,v 1.4 1995/07/28 06:41:39 phil Exp $
3.\"
4.\" Copyright (c) 1980, 1991, 1993
5.\"	The Regents of the University of California.  All rights reserved.
6.\" Portions Copyright(c) 1994, Jason Downs. All rights reserved.
7.\"
8.\" Redistribution and use in source and binary forms, with or without
9.\" modification, are permitted provided that the following conditions
10.\" are met:
11.\" 1. Redistributions of source code must retain the above copyright
12.\"    notice, this list of conditions and the following disclaimer.
13.\" 2. Redistributions in binary form must reproduce the above copyright
14.\"    notice, this list of conditions and the following disclaimer in the
15.\"    documentation and/or other materials provided with the distribution.
16.\" 3. All advertising materials mentioning features or use of this software
17.\"    must display the following acknowledgement:
18.\"	This product includes software developed by the University of
19.\"	California, Berkeley and its contributors.
20.\" 4. Neither the name of the University nor the names of its contributors
21.\"    may be used to endorse or promote products derived from this software
22.\"    without specific prior written permission.
23.\"
24.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
25.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
26.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
27.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
28.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
29.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
30.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
31.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
33.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34.\" SUCH DAMAGE.
35.\"
36.\"     @(#)group.5	8.3 (Berkeley) 4/19/94
37.\"
38.Dd July 18, 1995
39.Dt GROUP 5
40.Os
41.Sh NAME
42.Nm group
43.Nd format of the group permissions file
44.Sh DESCRIPTION
45The file
46.Pa /etc/group
47consists of newline separated
48.Tn ASCII
49records, one per group, containing four colon
50.Pq Ql \&:
51separated fields.
52These fields are as follows:
53.Pp
54.Bl -tag -width password -offset indent -compact
55.It group
56Name of the group.
57.It passwd
58Group's encrypted password.
59.It gid
60The group's decimal ID.
61.It member
62Group members.
63.El
64.Pp
65The
66.Ar group
67field is the group name used for granting file access to users
68who are members of the group.
69The
70.Ar gid
71field is the number associated with the group name.
72They should both be unique across the system (and often
73across a group of systems) since they control file access.
74The
75.Ar passwd
76field is an optional encrypted password.
77This field is rarely used and an asterisk is normally placed in it
78rather than leaving it blank.
79The
80.Ar member
81field contains the names of users granted the privileges of
82.Ar group .
83The member names are separated by commas without spaces or newlines.
84A user is automatically in a group if that group was specified in their
85.Pa /etc/passwd
86entry and does not need to be added to that group in the
87.Pa /etc/group
88file.
89.\" .Pp
90.\" When the system reads the file
91.\" .Pa /etc/group
92.\" the fields are read into the structure
93.\" .Fa group
94.\" declared in
95.\" .Aq Pa grp.h :
96.\" .Bd -literal -offset indent
97.\" struct group {
98.\"	char    *gr_name;        /* group name */
99.\"	char    *gr_passwd;      /* group password */
100.\"	int     gr_gid;          /* group id */
101.\"	char    **gr_mem;        /* group members */
102.\" };
103.\" .Ed
104.Sh YP SUPPORT
105If YP is active, the
106.Nm
107file may also contain lines of the format
108.Pp
109.Bd -literal -offset indent
110+name:*::
111.Ed
112.Pp
113which causes the specified group to be included from the
114.Pa group.byname
115YP map.
116If no group name is specified, or the
117.Ql +
118(plus sign) appears alone on a line, all groups are included from the YP map.
119.Pp
120YP references may appear anywhere in the file, but the single
121.Ql +
122form should be on the last line, for historical reasons.
123Only the first group with a specific name encountered, whether in the
124.Nm
125file itself, or included via YP, will be used.
126.Sh FILES
127.Bl -tag -width /etc/group -compact
128.It Pa /etc/group
129.El
130.Sh SEE ALSO
131.Xr passwd 1 ,
132.Xr setgroups 2 ,
133.Xr crypt 3 ,
134.Xr initgroups 3 ,
135.Xr passwd 5 ,
136.Xr yp 8
137.Sh BUGS
138The
139.Xr passwd 1
140command does not change the
141.Nm
142passwords.
143.Sh HISTORY
144A
145.Nm
146file format appeared in
147.At v6 .
148.Pp
149The YP file format first appeared in SunOS.
150