xref: /netbsd-src/share/man/man5/group.5 (revision d0fed6c87ddc40a8bffa6f99e7433ddfc864dd83)
1.\"	$NetBSD: group.5,v 1.5 1997/02/01 02:46:38 ghudson Exp $
2.\"
3.\" Copyright (c) 1980, 1991, 1993
4.\"	The Regents of the University of California.  All rights reserved.
5.\" Portions Copyright(c) 1994, Jason Downs. All rights reserved.
6.\"
7.\" Redistribution and use in source and binary forms, with or without
8.\" modification, are permitted provided that the following conditions
9.\" are met:
10.\" 1. Redistributions of source code must retain the above copyright
11.\"    notice, this list of conditions and the following disclaimer.
12.\" 2. Redistributions in binary form must reproduce the above copyright
13.\"    notice, this list of conditions and the following disclaimer in the
14.\"    documentation and/or other materials provided with the distribution.
15.\" 3. All advertising materials mentioning features or use of this software
16.\"    must display the following acknowledgement:
17.\"	This product includes software developed by the University of
18.\"	California, Berkeley and its contributors.
19.\" 4. Neither the name of the University nor the names of its contributors
20.\"    may be used to endorse or promote products derived from this software
21.\"    without specific prior written permission.
22.\"
23.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
24.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
27.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
28.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
29.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
32.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33.\" SUCH DAMAGE.
34.\"
35.\"     @(#)group.5	8.3 (Berkeley) 4/19/94
36.\"
37.Dd July 18, 1995
38.Dt GROUP 5
39.Os
40.Sh NAME
41.Nm group
42.Nd format of the group permissions file
43.Sh DESCRIPTION
44The file
45.Aq Pa /etc/group
46consists of newline separated
47.Tn ASCII
48records, one per group, containing four colon
49.Ql \&:
50separated fields. These fields are as follows:
51.Bl -tag -width password -offset indent -compact
52.It group
53Name of the group.
54.It passwd
55Group's
56.Em encrypted
57password.
58.It gid
59The group's decimal ID.
60.It member
61Group members.
62.El
63.Pp
64The
65.Ar group
66field is the group name used for granting file access to users
67who are members of the group.
68The
69.Ar gid
70field is the number associated with the group name.
71They should both be unique across the system (and often
72across a group of systems) since they control file access.
73The
74.Ar passwd
75field
76is an optional
77.Em encrypted
78password.
79This field is rarely used
80and an asterisk is normally placed in it rather than leaving it blank.
81The
82.Ar member
83field contains the names of users granted the privileges of
84.Ar group .
85The member names are separated by commas without spaces or newlines.
86A user is automatically in a group if that group was specified
87in their
88.Pa /etc/passwd
89entry and does not need to be added to that group in the
90.Pa /etc/group file.
91.\" .Pp
92.\" When the system reads the file
93.\" .Pa /etc/group
94.\" the fields are read into the structure
95.\" .Fa group
96.\" declared in
97.\" .Aq Pa grp.h :
98.\" .Bd -literal -offset indent
99.\" struct group {
100.\"	char    *gr_name;        /* group name */
101.\"	char    *gr_passwd;      /* group password */
102.\"	int     gr_gid;          /* group id */
103.\"	char    **gr_mem;        /* group members */
104.\" };
105.\" .Ed
106.Pp
107The group with gid 0 has a special meaning to the
108.Xr su 1
109command: if it exists and has any members, only users in that group
110are allowed to
111.Nm su
112to
113.Dq root .
114.Sh YP SUPPORT
115If YP is active, the
116.Nm
117file may also contain lines of the format
118.Pp
119.Bl -tag -offset indent -compact
120+name:*::
121.Pp
122which causes the specified group to be included from the
123.Pa group.byname
124YP map.
125.Pp
126If no group name is specified, or the ``+'' (plus sign) appears alone
127on line, all groups are included from the YP map.
128.Pp
129YP references may appear anywhere in the file, but the single ``+'' form
130should be on the last line, for historical reasons.
131Only the first group with a specific name encountered, whether in the
132.Nm
133file itself, or included via YP, will be used.
134.Sh FILES
135.Bl -tag -width /etc/group -compact
136.It Pa /etc/group
137.El
138.Sh SEE ALSO
139.Xr setgroups 2 ,
140.Xr initgroups 3 ,
141.Xr crypt 3 ,
142.Xr passwd 1 ,
143.Xr passwd 5 ,
144.Xr yp 8
145.Sh BUGS
146The
147.Xr passwd 1
148command does not change the
149.Nm group
150passwords.
151.Sh HISTORY
152A
153.Nm
154file format appeared in
155.At v6 .
156.Pp
157YP file format first appeared in SunOS.
158