1.\" $NetBSD: group.5,v 1.8 1999/03/10 09:31:18 erh 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 January 16, 1999 38.Dt GROUP 5 39.Os 40.Sh NAME 41.Nm group 42.Nd format of the group permissions file 43.Sh DESCRIPTION 44The 45.Nm 46file 47.Pa /etc/group 48is the local source of group information. 49It can be used in conjunction with the Hesiod domain 50.Sq group , 51and the 52.Tn NIS 53maps 54.Sq group.byname 55and 56.Sq group.bygid , 57as controlled by 58.Xr nsswitch.conf 5 . 59.Pp 60The 61.Nm 62file consists of newline separated 63.Tn ASCII 64records, one per group, containing four colon 65.Ql \&: 66separated fields. These fields are as follows: 67.Bl -tag -width password -offset indent -compact 68.It group 69Name of the group. 70.It passwd 71Group's 72.Em encrypted 73password. 74.It gid 75The group's decimal ID. 76.It member 77Group members. 78.El 79.Pp 80The 81.Ar group 82field is the group name used for granting file access to users 83who are members of the group. 84The 85.Ar gid 86field is the number associated with the group name. 87They should both be unique across the system (and often 88across a group of systems) since they control file access. 89The 90.Ar passwd 91field 92is an optional 93.Em encrypted 94password. 95This field is rarely used 96and an asterisk is normally placed in it rather than leaving it blank. 97The 98.Ar member 99field contains the names of users granted the privileges of 100.Ar group . 101The member names are separated by commas without spaces or newlines. 102A user is automatically in a group if that group was specified 103in their 104.Pa /etc/passwd 105entry and does not need to be added to that group in the 106.Pa /etc/group file. 107.Pp 108The group with the name 109.Dq wheel 110has a special meaning to the 111.Xr su 1 112command: if it exists and has any members, only users listed in that group 113are allowed to 114.Nm su 115to 116.Dq root . 117.Sh HESIOD SUPPORT 118If 119.Sq dns 120is specified for the 121.Sq group 122database in 123.Xr nsswitch.conf 5 , 124then 125.Nm 126lookups occur from the 127.Sq group 128Hesiod domain. 129.Sh NIS SUPPORT 130If 131.Sq nis 132is specified for the 133.Sq group 134database in 135.Xr nsswitch.conf 5 , 136then 137.Nm 138lookups occur from the 139.Sq group.byname 140and 141.Sq group.bygid 142.Tn NIS 143map. 144.Sh COMPAT SUPPORT 145If 146.Sq compat 147is specified for the 148.Sq group 149database, and either 150.Sq dns 151or 152.Sq nis 153is specified for the 154.Sq group_compat 155database in 156.Xr nsswitch.conf 5 , 157then the 158.Nm 159file may also contain lines of the format 160.Pp 161+name:*:: 162.Pp 163which causes the specified group to be included from the 164.Sq group 165Hesiod domain 166or the 167.Sq group.byname 168.Tn NIS 169map (respectively). 170.Pp 171If no group name is specified, or the ``+'' (plus sign) appears alone 172on line, all groups are included from the 173Hesiod domain or the 174.Tn NIS 175map. 176.Pp 177Hesiod or 178.Tn NIS 179compat references may appear anywhere in the file, but the single ``+'' form 180should be on the last line, for historical reasons. 181Only the first group with a specific name encountered, whether in the 182.Nm 183file itself, or included via Hesiod or 184.Tn NIS , 185will be used. 186.Sh FILES 187.Bl -tag -width /etc/group -compact 188.It Pa /etc/group 189.El 190.Sh SEE ALSO 191.Xr passwd 1 , 192.Xr su 1 , 193.Xr setgroups 2 , 194.Xr initgroups 3 , 195.Xr crypt 3 , 196.Xr nsswitch.conf 5 , 197.Xr passwd 5 , 198.Xr yp 8 199.Sh BUGS 200The 201.Xr passwd 1 202command does not change the 203.Nm group 204passwords. 205.Sh HISTORY 206A 207.Nm 208file format appeared in 209.At v6 . 210.Pp 211The 212.Tn NIS 213file format first appeared in SunOS. 214.Pp 215The Hesiod support first appeared in 216.Nx 1.4 . 217