xref: /netbsd/share/man/man5/group.5 (revision bf9ec67e)
1.\"	$NetBSD: group.5,v 1.14 2001/09/11 01:01:57 wiz Exp $
2.\"
3.\" Copyright (c) 1980, 1991, 1993
4.\"	The Regents of the University of California.  All rights reserved.
5.\" Portions Copyright(c) 1994, Jason Downs. All rights reserved.
6.\"
7.\" Redistribution and use in source and binary forms, with or without
8.\" modification, are permitted provided that the following conditions
9.\" are met:
10.\" 1. Redistributions of source code must retain the above copyright
11.\"    notice, this list of conditions and the following disclaimer.
12.\" 2. Redistributions in binary form must reproduce the above copyright
13.\"    notice, this list of conditions and the following disclaimer in the
14.\"    documentation and/or other materials provided with the distribution.
15.\" 3. All advertising materials mentioning features or use of this software
16.\"    must display the following acknowledgement:
17.\"	This product includes software developed by the University of
18.\"	California, Berkeley and its contributors.
19.\" 4. Neither the name of the University nor the names of its contributors
20.\"    may be used to endorse or promote products derived from this software
21.\"    without specific prior written permission.
22.\"
23.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
24.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
27.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
28.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
29.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
32.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33.\" SUCH DAMAGE.
34.\"
35.\"     @(#)group.5	8.3 (Berkeley) 4/19/94
36.\"
37.Dd November 17, 2000
38.Dt GROUP 5
39.Os
40.Sh NAME
41.Nm group
42.Nd format of the group permissions file
43.Sh DESCRIPTION
44The
45.Nm
46file
47.Pa /etc/group
48is the local source of group information.
49It can be used in conjunction with the Hesiod domain
50.Sq group ,
51and the
52.Tn NIS
53maps
54.Sq group.byname
55and
56.Sq group.bygid ,
57as controlled by
58.Xr nsswitch.conf 5 .
59.Pp
60The
61.Nm
62file consists of newline separated
63.Tn ASCII
64records, one per group, containing four colon
65.Ql \&:
66separated fields.
67Each line has the form:
68.Dl group:passwd:gid:[member[,member]...]
69.Pp
70These fields are as follows:
71.Bl -tag -width password -offset indent -compact
72.It Em group
73Name of the group.
74.It Em passwd
75Group's
76.Em encrypted
77password.
78.It Em gid
79The group's decimal ID.
80.It Em member
81Group members.
82.El
83.Pp
84The
85.Em group
86field is the group name used for granting file access to users
87who are members of the group.
88.Pp
89The
90.Em gid
91field is the number associated with the group name.
92They should both be unique across the system (and often
93across a group of systems) since they control file access.
94.Pp
95The
96.Em passwd
97field
98is an optional
99.Em encrypted
100password.
101This field is rarely used
102and an asterisk is normally placed in it rather than leaving it blank.
103.Pp
104The
105.Em member
106field contains the names of users granted the privileges of
107.Em group .
108The member names are separated by commas without spaces or newlines.
109A user is automatically in a group if that group was specified
110in their
111.Pa /etc/passwd
112entry and does not need to be added to that group in the
113.Pa /etc/group
114file.
115.Pp
116The group with the name
117.Dq wheel
118has a special meaning to the
119.Xr su 1
120command: if it exists and has any members, only users listed in that group
121are allowed to
122.Nm su
123to
124.Dq root .
125.Sh HESIOD SUPPORT
126If
127.Sq dns
128is specified for the
129.Sq group
130database in
131.Xr nsswitch.conf 5 ,
132then
133.Nm
134lookups occur from the
135.Sq group
136Hesiod domain.
137.Sh NIS SUPPORT
138If
139.Sq nis
140is specified for the
141.Sq group
142database in
143.Xr nsswitch.conf 5 ,
144then
145.Nm
146lookups occur from the
147.Sq group.byname
148and
149.Sq group.bygid
150.Tn NIS
151map.
152.Sh COMPAT SUPPORT
153If
154.Sq compat
155is specified for the
156.Sq group
157database, and either
158.Sq dns
159or
160.Sq nis
161is specified for the
162.Sq group_compat
163database in
164.Xr nsswitch.conf 5 ,
165then the
166.Nm
167file may also contain lines of the format
168.Pp
169+name:*::
170.Pp
171which causes the specified group to be included from the
172.Sq group
173Hesiod domain
174or the
175.Sq group.byname
176.Tn NIS
177map (respectively).
178.Pp
179If no group name is specified, or the plus sign
180.Pq Dq \&+
181appears alone
182on line, all groups are included from the
183Hesiod domain or the
184.Tn NIS
185map.
186.Pp
187Hesiod or
188.Tn NIS
189compat references may appear anywhere in the file, but the single
190plus sign
191.Pq Dq \&+
192form should be on the last line, for historical reasons.
193Only the first group with a specific name encountered, whether in the
194.Nm
195file itself, or included via Hesiod or
196.Tn NIS ,
197will be used.
198.Sh FILES
199.Bl -tag -width /etc/group -compact
200.It Pa /etc/group
201.El
202.Sh SEE ALSO
203.Xr passwd 1 ,
204.Xr su 1 ,
205.Xr setgroups 2 ,
206.Xr crypt 3 ,
207.Xr initgroups 3 ,
208.Xr nsswitch.conf 5 ,
209.Xr passwd 5 ,
210.Xr yp 8
211.Sh HISTORY
212A
213.Nm
214file format appeared in
215.At v6 .
216.Pp
217The
218.Tn NIS
219file format first appeared in SunOS.
220.Pp
221The Hesiod support first appeared in
222.Nx 1.4 .
223.Sh BUGS
224The
225.Xr passwd 1
226command does not change the
227.Nm group
228passwords.
229