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