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