xref: /netbsd-src/share/man/man5/group.5 (revision 2a399c6883d870daece976daec6ffa7bb7f934ce)
1.\"	$NetBSD: group.5,v 1.6 1997/07/02 06:19:54 lukem 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 the name
108.Dq wheel
109has a special meaning to the
110.Xr su 1
111command: if it exists and has any members, only users listed in that group
112are allowed to
113.Nm su
114to
115.Dq root .
116.Sh YP SUPPORT
117If YP is active, the
118.Nm
119file may also contain lines of the format
120.Pp
121.Bl -tag -offset indent -compact
122+name:*::
123.Pp
124which causes the specified group to be included from the
125.Pa group.byname
126YP map.
127.Pp
128If no group name is specified, or the ``+'' (plus sign) appears alone
129on line, all groups are included from the YP map.
130.Pp
131YP references may appear anywhere in the file, but the single ``+'' form
132should be on the last line, for historical reasons.
133Only the first group with a specific name encountered, whether in the
134.Nm
135file itself, or included via YP, will be used.
136.Sh FILES
137.Bl -tag -width /etc/group -compact
138.It Pa /etc/group
139.El
140.Sh SEE ALSO
141.Xr su 1 ,
142.Xr setgroups 2 ,
143.Xr initgroups 3 ,
144.Xr crypt 3 ,
145.Xr passwd 1 ,
146.Xr passwd 5 ,
147.Xr yp 8
148.Sh BUGS
149The
150.Xr passwd 1
151command does not change the
152.Nm group
153passwords.
154.Sh HISTORY
155A
156.Nm
157file format appeared in
158.At v6 .
159.Pp
160YP file format first appeared in SunOS.
161