1.\" $NetBSD: group.5,v 1.4 1995/07/28 06:41:39 phil 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.Sh YP SUPPORT 107If YP is active, the 108.Nm 109file may also contain lines of the format 110.Pp 111.Bl -tag -offset indent -compact 112+name:*:: 113.Pp 114which causes the specified group to be included from the 115.Pa group.byname 116YP map. 117.Pp 118If no group name is specified, or the ``+'' (plus sign) appears alone 119on line, all groups are included from the YP map. 120.Pp 121YP references may appear anywhere in the file, but the single ``+'' form 122should be on the last line, for historical reasons. 123Only the first group with a specific name encountered, whether in the 124.Nm 125file itself, or included via YP, will be used. 126.Sh FILES 127.Bl -tag -width /etc/group -compact 128.It Pa /etc/group 129.El 130.Sh SEE ALSO 131.Xr setgroups 2 , 132.Xr initgroups 3 , 133.Xr crypt 3 , 134.Xr passwd 1 , 135.Xr passwd 5 , 136.Xr yp 8 137.Sh BUGS 138The 139.Xr passwd 1 140command does not change the 141.Nm group 142passwords. 143.Sh HISTORY 144A 145.Nm 146file format appeared in 147.At v6 . 148.Pp 149YP file format first appeared in SunOS. 150