sync
[bitrig.git] / share / man / man5 / group.5
bloba23349bfbbf60f7aea0e18358513cbeba8ad9dd3
1 .\"     $OpenBSD: group.5,v 1.15 2012/06/20 22:15:13 schwarze 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. Neither the name of the University nor the names of its contributors
17 .\"    may be used to endorse or promote products derived from this software
18 .\"    without specific prior written permission.
19 .\"
20 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
21 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
24 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 .\" SUCH DAMAGE.
31 .\"
32 .\"     @(#)group.5     8.3 (Berkeley) 4/19/94
33 .\"
34 .Dd $Mdocdate: June 20 2012 $
35 .Dt GROUP 5
36 .Os
37 .Sh NAME
38 .Nm group
39 .Nd format of the group permissions file
40 .Sh DESCRIPTION
41 The file
42 .Pa /etc/group
43 consists of newline separated
44 .Tn ASCII
45 records, one per group, containing four colon
46 .Pq Ql \&:
47 separated fields.
48 These fields are as follows:
49 .Pp
50 .Bl -tag -width password -offset indent -compact
51 .It group
52 Name of the group.
53 .It passwd
54 Group's encrypted password.
55 .It gid
56 The group's decimal ID.
57 .It member
58 Group members.
59 .El
60 .Pp
61 The
62 .Ar group
63 field is the group name used for granting file access to users
64 who are members of the group.
65 The
66 .Ar gid
67 field is the number associated with the group name.
68 They should both be unique across the system (and often
69 across a group of systems) since they control file access.
70 The
71 .Ar passwd
72 field is an optional encrypted password.
73 This field is rarely used and an asterisk is normally placed in it
74 rather than leaving it blank.
75 The
76 .Ar member
77 field contains the names of users granted the privileges of
78 .Ar group .
79 The member names are separated by commas without spaces or newlines.
80 A user is automatically in a group if that group was specified in their
81 .Xr passwd 5
82 entry and does not need to be added to that group in the
83 .Nm
84 file.
85 .\" .Pp
86 .\" When the system reads the file
87 .\" .Pa /etc/group
88 .\" the fields are read into the structure
89 .\" .Fa group
90 .\" declared in
91 .\" .Aq Pa grp.h :
92 .\" .Bd -literal -offset indent
93 .\" struct group {
94 .\"     char    *gr_name;        /* group name */
95 .\"     char    *gr_passwd;      /* group password */
96 .\"     int     gr_gid;          /* group id */
97 .\"     char    **gr_mem;        /* group members */
98 .\" };
99 .\" .Ed
100 .Sh YP SUPPORT
101 If YP is active, the
103 file also supports YP exclusions and inclusions.
105 Lines beginning with a
106 .Ql \&-
107 (minus sign) are entries marked as being excluded from any following
108 inclusions, which are marked with a `+' (plus sign).
110 Lines of the format
111 .Bd -literal -offset indent
112 +name:*::
115 cause the specified group to be included from the
116 .Pa group.byname
117 YP map.
118 If no group name is specified, or the
119 .Ql +
120 (plus sign) appears alone on a line, all groups are included from the YP map.
122 YP references may appear anywhere in the file, but the single
123 .Ql +
124 form should be on the last line, for historical reasons.
125 Only the first group with a specific name encountered, whether in the
127 file itself, or included via YP, will be used.
129 Proper YP group support requires consistent
130 .Pa group.byname ,
131 .Pa group.bygid
133 .Pa netid.byname
134 YP maps.
136 .Xr getgrent 3
138 .Xr getgrouplist 3
139 for details.
141 When YP is enabled but temporarily unavailable, login becomes impossible
142 for all users except those having an entry in the
143 .Xr netid 5
144 file.
145 .Sh FILES
146 .Bl -tag -width /etc/group -compact
147 .It Pa /etc/group
149 .Sh SEE ALSO
150 .Xr passwd 1 ,
151 .Xr setgroups 2 ,
152 .Xr crypt 3 ,
153 .Xr initgroups 3 ,
154 .Xr netid 5 ,
155 .Xr passwd 5 ,
156 .Xr yp 8
157 .Sh HISTORY
160 file format first appeared in
161 .At v6 .
163 The YP file format first appeared in SunOS.
164 .Sh BUGS
166 .Xr passwd 1
167 command does not change the
169 passwords.
171 Lines in
172 .Pa /etc/group
173 are limited to 1024 characters.
174 YP groups are not affected by this limit.
176 Groups are limited to a maximum of 200 members per group.