1*166859c3Swiz.\" $NetBSD: group.5,v 1.19 2009/05/13 22:33:59 wiz Exp $ 2b5930afcSjtc.\" 3b5930afcSjtc.\" Copyright (c) 1980, 1991, 1993 4b5930afcSjtc.\" The Regents of the University of California. All rights reserved. 5075022b3Sagc.\" 6075022b3Sagc.\" Redistribution and use in source and binary forms, with or without 7075022b3Sagc.\" modification, are permitted provided that the following conditions 8075022b3Sagc.\" are met: 9075022b3Sagc.\" 1. Redistributions of source code must retain the above copyright 10075022b3Sagc.\" notice, this list of conditions and the following disclaimer. 11075022b3Sagc.\" 2. Redistributions in binary form must reproduce the above copyright 12075022b3Sagc.\" notice, this list of conditions and the following disclaimer in the 13075022b3Sagc.\" documentation and/or other materials provided with the distribution. 14075022b3Sagc.\" 3. Neither the name of the University nor the names of its contributors 15075022b3Sagc.\" may be used to endorse or promote products derived from this software 16075022b3Sagc.\" without specific prior written permission. 17075022b3Sagc.\" 18075022b3Sagc.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 19075022b3Sagc.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20075022b3Sagc.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21075022b3Sagc.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 22075022b3Sagc.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23075022b3Sagc.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 24075022b3Sagc.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 25075022b3Sagc.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 26075022b3Sagc.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 27075022b3Sagc.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 28075022b3Sagc.\" SUCH DAMAGE. 29075022b3Sagc.\" 30c9d0b91dSphil.\" Portions Copyright(c) 1994, Jason Downs. All rights reserved. 3161f28255Scgd.\" 3261f28255Scgd.\" Redistribution and use in source and binary forms, with or without 3361f28255Scgd.\" modification, are permitted provided that the following conditions 3461f28255Scgd.\" are met: 3561f28255Scgd.\" 1. Redistributions of source code must retain the above copyright 3661f28255Scgd.\" notice, this list of conditions and the following disclaimer. 3761f28255Scgd.\" 2. Redistributions in binary form must reproduce the above copyright 3861f28255Scgd.\" notice, this list of conditions and the following disclaimer in the 3961f28255Scgd.\" documentation and/or other materials provided with the distribution. 4061f28255Scgd.\" 419f1aac5bSagc.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS 429f1aac5bSagc.\" OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 439f1aac5bSagc.\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 449f1aac5bSagc.\" DISCLAIMED. IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, 459f1aac5bSagc.\" INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 469f1aac5bSagc.\" (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 479f1aac5bSagc.\" SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 489f1aac5bSagc.\" CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 4961f28255Scgd.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 5061f28255Scgd.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 5161f28255Scgd.\" SUCH DAMAGE. 5261f28255Scgd.\" 53b5930afcSjtc.\" @(#)group.5 8.3 (Berkeley) 4/19/94 5461f28255Scgd.\" 558d82f5f6Sginsbach.Dd June 21, 2007 5661f28255Scgd.Dt GROUP 5 5761f28255Scgd.Os 5861f28255Scgd.Sh NAME 5961f28255Scgd.Nm group 6061f28255Scgd.Nd format of the group permissions file 6161f28255Scgd.Sh DESCRIPTION 62abda4debSlukemThe 63abda4debSlukem.Nm 64abda4debSlukemfile 65abda4debSlukem.Pa /etc/group 66abda4debSlukemis the local source of group information. 67abda4debSlukemIt can be used in conjunction with the Hesiod domain 68abda4debSlukem.Sq group , 69abda4debSlukemand the 70abda4debSlukem.Tn NIS 71abda4debSlukemmaps 72abda4debSlukem.Sq group.byname 73abda4debSlukemand 74abda4debSlukem.Sq group.bygid , 75abda4debSlukemas controlled by 76abda4debSlukem.Xr nsswitch.conf 5 . 77abda4debSlukem.Pp 78abda4debSlukemThe 79abda4debSlukem.Nm 80abda4debSlukemfile consists of newline separated 8161f28255Scgd.Tn ASCII 82964c0396Sjmmvrecords, usually one per group, containing four colon 8361f28255Scgd.Ql \&: 84ee3b51edSlukemseparated fields. 85ee3b51edSlukemEach line has the form: 86ee3b51edSlukem.Dl group:passwd:gid:[member[,member]...] 87ee3b51edSlukem.Pp 88ee3b51edSlukemThese fields are as follows: 8961f28255Scgd.Bl -tag -width password -offset indent -compact 90ff1595ffSlukem.It Em group 9161f28255ScgdName of the group. 92ff1595ffSlukem.It Em passwd 9361f28255ScgdGroup's 9461f28255Scgd.Em encrypted 9561f28255Scgdpassword. 96ff1595ffSlukem.It Em gid 9761f28255ScgdThe group's decimal ID. 98ff1595ffSlukem.It Em member 9961f28255ScgdGroup members. 10061f28255Scgd.El 10161f28255Scgd.Pp 10261f28255ScgdThe 103ff1595ffSlukem.Em group 10461f28255Scgdfield is the group name used for granting file access to users 10561f28255Scgdwho are members of the group. 106ee3b51edSlukem.Pp 10761f28255ScgdThe 108ff1595ffSlukem.Em gid 10961f28255Scgdfield is the number associated with the group name. 11061f28255ScgdThey should both be unique across the system (and often 11161f28255Scgdacross a group of systems) since they control file access. 112ee3b51edSlukem.Pp 11361f28255ScgdThe 114ff1595ffSlukem.Em passwd 11561f28255Scgdfield 11661f28255Scgdis an optional 11761f28255Scgd.Em encrypted 11861f28255Scgdpassword. 11961f28255ScgdThis field is rarely used 12061f28255Scgdand an asterisk is normally placed in it rather than leaving it blank. 121ee3b51edSlukem.Pp 12261f28255ScgdThe 123ff1595ffSlukem.Em member 124b5930afcSjtcfield contains the names of users granted the privileges of 125ff1595ffSlukem.Em group . 12661f28255ScgdThe member names are separated by commas without spaces or newlines. 12761f28255ScgdA user is automatically in a group if that group was specified 12861f28255Scgdin their 12961f28255Scgd.Pa /etc/passwd 13061f28255Scgdentry and does not need to be added to that group in the 131cc65fbeeSwiz.Pa /etc/group 132cc65fbeeSwizfile. 133fc073ea1Sghudson.Pp 134964c0396SjmmvVery large groups can be accommodated over multiple lines by specifying the 135964c0396Sjmmvsame group name in all of them; other than this, each line has an identical 136964c0396Sjmmvformat to that described above. 137964c0396SjmmvThis can be necessary to avoid the record's length limit, which is currently 138964c0396Sjmmvset to 1024 characters. 139964c0396SjmmvNote that the limit can be queried through 140964c0396Sjmmv.Xr sysconf 3 141964c0396Sjmmvby using the 142964c0396Sjmmv.Li _SC_GETGR_R_SIZE_MAX 143964c0396Sjmmvparameter. 144964c0396SjmmvFor example: 145964c0396Sjmmv.Bd -literal -offset indent 146964c0396Sjmmvbiggrp:*:1000:user001,user002,user003,...,user099,user100 147964c0396Sjmmvbiggrp:*:1000:user101,user102,user103,... 148964c0396Sjmmv.Ed 149964c0396Sjmmv.Pp 15024bf9e11SlukemThe group with the name 15124bf9e11Slukem.Dq wheel 15224bf9e11Slukemhas a special meaning to the 153fc073ea1Sghudson.Xr su 1 15424bf9e11Slukemcommand: if it exists and has any members, only users listed in that group 155fc073ea1Sghudsonare allowed to 156fc073ea1Sghudson.Nm su 157fc073ea1Sghudsonto 158fc073ea1Sghudson.Dq root . 159abda4debSlukem.Sh HESIOD SUPPORT 160abda4debSlukemIf 161abda4debSlukem.Sq dns 162abda4debSlukemis specified for the 163abda4debSlukem.Sq group 164abda4debSlukemdatabase in 165abda4debSlukem.Xr nsswitch.conf 5 , 166abda4debSlukemthen 167abda4debSlukem.Nm 168abda4debSlukemlookups occur from the 169abda4debSlukem.Sq group 170abda4debSlukemHesiod domain. 171abda4debSlukem.Sh NIS SUPPORT 172abda4debSlukemIf 173abda4debSlukem.Sq nis 174abda4debSlukemis specified for the 175abda4debSlukem.Sq group 176abda4debSlukemdatabase in 177abda4debSlukem.Xr nsswitch.conf 5 , 178abda4debSlukemthen 179abda4debSlukem.Nm 180abda4debSlukemlookups occur from the 181abda4debSlukem.Sq group.byname 182abda4debSlukemand 183abda4debSlukem.Sq group.bygid 184abda4debSlukem.Tn NIS 185abda4debSlukemmap. 186abda4debSlukem.Sh COMPAT SUPPORT 187abda4debSlukemIf 188abda4debSlukem.Sq compat 189abda4debSlukemis specified for the 190abda4debSlukem.Sq group 191abda4debSlukemdatabase, and either 192abda4debSlukem.Sq dns 193abda4debSlukemor 194abda4debSlukem.Sq nis 195abda4debSlukemis specified for the 196abda4debSlukem.Sq group_compat 197abda4debSlukemdatabase in 198abda4debSlukem.Xr nsswitch.conf 5 , 199abda4debSlukemthen the 200c9d0b91dSphil.Nm 201c9d0b91dSphilfile may also contain lines of the format 202c9d0b91dSphil.Pp 203c9d0b91dSphil+name:*:: 204c9d0b91dSphil.Pp 205c9d0b91dSphilwhich causes the specified group to be included from the 206abda4debSlukem.Sq group 207abda4debSlukemHesiod domain 208abda4debSlukemor the 209abda4debSlukem.Sq group.byname 210abda4debSlukem.Tn NIS 211abda4debSlukemmap (respectively). 212c9d0b91dSphil.Pp 21371e62d7dSlukemIf no group name is specified, or the plus sign 21471e62d7dSlukem.Pq Dq \&+ 21571e62d7dSlukemappears alone 216abda4debSlukemon line, all groups are included from the 217abda4debSlukemHesiod domain or the 218abda4debSlukem.Tn NIS 219abda4debSlukemmap. 220c9d0b91dSphil.Pp 221abda4debSlukemHesiod or 222abda4debSlukem.Tn NIS 22371e62d7dSlukemcompat references may appear anywhere in the file, but the single 22471e62d7dSlukemplus sign 22571e62d7dSlukem.Pq Dq \&+ 22671e62d7dSlukemform should be on the last line, for historical reasons. 227c9d0b91dSphilOnly the first group with a specific name encountered, whether in the 228c9d0b91dSphil.Nm 229abda4debSlukemfile itself, or included via Hesiod or 230abda4debSlukem.Tn NIS , 231abda4debSlukemwill be used. 23261f28255Scgd.Sh FILES 23361f28255Scgd.Bl -tag -width /etc/group -compact 23461f28255Scgd.It Pa /etc/group 23561f28255Scgd.El 23661f28255Scgd.Sh SEE ALSO 2378d82f5f6Sginsbach.Xr newgrp 1 , 238*166859c3Swiz.Xr passwd 1 , 23924bf9e11Slukem.Xr su 1 , 24061f28255Scgd.Xr setgroups 2 , 24161f28255Scgd.Xr crypt 3 , 24242704c41Swiz.Xr initgroups 3 , 243abda4debSlukem.Xr nsswitch.conf 5 , 244c9d0b91dSphil.Xr passwd 5 , 245c9d0b91dSphil.Xr yp 8 24661f28255Scgd.Sh HISTORY 24761f28255ScgdA 24861f28255Scgd.Nm 24961f28255Scgdfile format appeared in 25061f28255Scgd.At v6 . 251c9d0b91dSphil.Pp 252abda4debSlukemThe 253abda4debSlukem.Tn NIS 254abda4debSlukemfile format first appeared in SunOS. 255abda4debSlukem.Pp 256abda4debSlukemThe Hesiod support first appeared in 257abda4debSlukem.Nx 1.4 . 25842704c41Swiz.Sh BUGS 25942704c41SwizThe 26042704c41Swiz.Xr passwd 1 26142704c41Swizcommand does not change the 26242704c41Swiz.Nm group 26342704c41Swizpasswords. 264