xref: /freebsd/share/man/man5/group.5 (revision a0b9e2e854027e6ff61fb075a1309dbc71c42b54)
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.\" $FreeBSD$
30.\"
31.Dd February 8, 2013
32.Dt GROUP 5
33.Os
34.Sh NAME
35.Nm group
36.Nd format of the group permissions file
37.Sh DESCRIPTION
38The
39.Nm
40file is the local source of group information.
41It can be used in conjunction with the Hesiod domain
42`group', and the NIS maps `group.byname' and `group.bygid',
43as controlled by
44.Xr nsswitch.conf 5 .
45.Pp
46The file
47.Nm
48consists of newline separated
49.Tn ASCII
50records, one per group, containing four colon
51.Ql \&:
52separated fields.
53These fields are as follows:
54.Bl -tag -width password -offset indent -compact
55.It group
56Name of the group.
57.It passwd
58Group's
59.Em encrypted
60password.
61.It gid
62The group's decimal ID.
63.It member
64Group members.
65.El
66.Pp
67Lines whose first non-whitespace character is a pound-sign (#)
68are comments, and are ignored.
69Blank lines that consist
70only of spaces, tabs or newlines are also ignored.
71.Pp
72The
73.Ar group
74field is the group name used for granting file access to users
75who are members of the group.
76The
77.Ar gid
78field is the number associated with the group name.
79They should both be unique across the system (and often
80across a group of systems) since they control file access.
81The
82.Ar passwd
83field
84is an optional
85.Em encrypted
86password.
87This field is rarely used
88and an asterisk is normally placed in it rather than leaving it blank.
89The
90.Ar member
91field contains the names of users granted the privileges of
92.Ar group .
93The member names are separated by commas without spaces or newlines.
94A user is automatically in a group if that group was specified
95in their
96.Pa /etc/passwd
97entry and does not need to be added to that group in the
98.Nm
99file.
100.\" .Pp
101.\" When the system reads the file
102.\" .Pa /etc/group
103.\" the fields are read into the structure
104.\" .Fa group
105.\" declared in
106.\" .In grp.h :
107.\" .Bd -literal -offset indent
108.\" struct group {
109.\"	char    *gr_name;        /* group name */
110.\"	char    *gr_passwd;      /* group password */
111.\"	int     gr_gid;          /* group id */
112.\"	char    **gr_mem;        /* group members */
113.\" };
114.\" .Ed
115.Sh IMPLEMENTATION NOTES
116The
117.Xr passwd 1
118command does not change the
119.Nm
120passwords.
121The
122.Xr pw 8
123utility's
124.Cm groupmod
125command should be used instead.
126.Sh LIMITS
127There are various limitations which are explained in
128the function where they occur; see section
129.Sx SEE ALSO .
130.Pp
131In older implementations,
132a group cannot have more than 200 members.
133The maximum line length of
134.Pa /etc/group
135is 1024 characters.
136Longer lines will be skipped.
137This limitation disappeared in
138.Fx 3.0 .
139Older binaries that are statically linked, depend on old
140shared libraries, or
141.No non- Ns Fx
142binaries in compatibility mode
143may still have this limit.
144.Sh FILES
145.Bl -tag -width /etc/group -compact
146.It Pa /etc/group
147.El
148.Sh SEE ALSO
149.Xr newgrp 1 ,
150.Xr passwd 1 ,
151.Xr setgroups 2 ,
152.Xr crypt 3 ,
153.Xr getgrent 3 ,
154.Xr initgroups 3 ,
155.Xr nsswitch.conf 5 ,
156.Xr passwd 5 ,
157.Xr chkgrp 8 ,
158.Xr pw 8 ,
159.Xr yp 8
160.Sh HISTORY
161A
162.Nm
163file format appeared in
164.At v6 .
165Support for comments first appeared in
166.Fx 3.0 .
167