xref: /freebsd/share/man/man5/group.5 (revision 315ee00f)
1.\" Copyright (c) 1980, 1991, 1993
2.\"	The Regents of the University of California.  All rights reserved.
3.\"
4.\" Redistribution and use in source and binary forms, with or without
5.\" modification, are permitted provided that the following conditions
6.\" are met:
7.\" 1. Redistributions of source code must retain the above copyright
8.\"    notice, this list of conditions and the following disclaimer.
9.\" 2. Redistributions in binary form must reproduce the above copyright
10.\"    notice, this list of conditions and the following disclaimer in the
11.\"    documentation and/or other materials provided with the distribution.
12.\" 3. Neither the name of the University nor the names of its contributors
13.\"    may be used to endorse or promote products derived from this software
14.\"    without specific prior written permission.
15.\"
16.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
17.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
20.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26.\" SUCH DAMAGE.
27.\"
28.\"     From: @(#)group.5	8.3 (Berkeley) 4/19/94
29.\"
30.Dd February 8, 2013
31.Dt GROUP 5
32.Os
33.Sh NAME
34.Nm group
35.Nd format of the group permissions file
36.Sh DESCRIPTION
37The
38.Nm
39file is the local source of group information.
40It can be used in conjunction with the Hesiod domain
41`group', and the NIS maps `group.byname' and `group.bygid',
42as controlled by
43.Xr nsswitch.conf 5 .
44.Pp
45The file
46.Nm
47consists of newline separated
48.Tn ASCII
49records, one per group, containing four colon
50.Ql \&:
51separated fields.
52These fields are as follows:
53.Bl -tag -width password -offset indent -compact
54.It group
55Name of the group.
56.It passwd
57Group's
58.Em encrypted
59password.
60.It gid
61The group's decimal ID.
62.It member
63Group members.
64.El
65.Pp
66Lines whose first non-whitespace character is a pound-sign (#)
67are comments, and are ignored.
68Blank lines that consist
69only of spaces, tabs or newlines are also ignored.
70.Pp
71The
72.Ar group
73field is the group name used for granting file access to users
74who are members of the group.
75The
76.Ar gid
77field is the number associated with the group name.
78They should both be unique across the system (and often
79across a group of systems) since they control file access.
80The
81.Ar passwd
82field
83is an optional
84.Em encrypted
85password.
86This field is rarely used
87and an asterisk is normally placed in it rather than leaving it blank.
88The
89.Ar member
90field contains the names of users granted the privileges of
91.Ar group .
92The member names are separated by commas without spaces or newlines.
93A user is automatically in a group if that group was specified
94in their
95.Pa /etc/passwd
96entry and does not need to be added to that group in the
97.Nm
98file.
99.\" .Pp
100.\" When the system reads the file
101.\" .Pa /etc/group
102.\" the fields are read into the structure
103.\" .Fa group
104.\" declared in
105.\" .In grp.h :
106.\" .Bd -literal -offset indent
107.\" struct group {
108.\"	char    *gr_name;        /* group name */
109.\"	char    *gr_passwd;      /* group password */
110.\"	int     gr_gid;          /* group id */
111.\"	char    **gr_mem;        /* group members */
112.\" };
113.\" .Ed
114.Sh IMPLEMENTATION NOTES
115The
116.Xr passwd 1
117command does not change the
118.Nm
119passwords.
120The
121.Xr pw 8
122utility's
123.Cm groupmod
124command should be used instead.
125.Sh LIMITS
126There are various limitations which are explained in
127the function where they occur; see section
128.Sx SEE ALSO .
129.Pp
130In older implementations,
131a group cannot have more than 200 members.
132The maximum line length of
133.Pa /etc/group
134is 1024 characters.
135Longer lines will be skipped.
136This limitation disappeared in
137.Fx 3.0 .
138Older binaries that are statically linked, depend on old
139shared libraries, or
140.No non- Ns Fx
141binaries in compatibility mode
142may still have this limit.
143.Sh FILES
144.Bl -tag -width /etc/group -compact
145.It Pa /etc/group
146.El
147.Sh SEE ALSO
148.Xr newgrp 1 ,
149.Xr passwd 1 ,
150.Xr setgroups 2 ,
151.Xr crypt 3 ,
152.Xr getgrent 3 ,
153.Xr initgroups 3 ,
154.Xr nsswitch.conf 5 ,
155.Xr passwd 5 ,
156.Xr chkgrp 8 ,
157.Xr pw 8 ,
158.Xr yp 8
159.Sh HISTORY
160A
161.Nm
162file format appeared in
163.At v6 .
164Support for comments first appeared in
165.Fx 3.0 .
166