]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - share/man/man5/group.5
Merge bmake-20240309
[FreeBSD/FreeBSD.git] / share / man / man5 / group.5
1 .\" Copyright (c) 1980, 1991, 1993
2 .\"     The Regents of the University of California.  All rights reserved.
3 .\"
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
6 .\" are met:
7 .\" 1. Redistributions of source code must retain the above copyright
8 .\"    notice, this list of conditions and the following disclaimer.
9 .\" 2. Redistributions in binary form must reproduce the above copyright
10 .\"    notice, this list of conditions and the following disclaimer in the
11 .\"    documentation and/or other materials provided with the distribution.
12 .\" 3. Neither the name of the University nor the names of its contributors
13 .\"    may be used to endorse or promote products derived from this software
14 .\"    without specific prior written permission.
15 .\"
16 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
17 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
20 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26 .\" SUCH DAMAGE.
27 .\"
28 .Dd February 8, 2013
29 .Dt GROUP 5
30 .Os
31 .Sh NAME
32 .Nm group
33 .Nd format of the group permissions file
34 .Sh DESCRIPTION
35 The
36 .Nm
37 file is the local source of group information.
38 It can be used in conjunction with the Hesiod domain
39 `group', and the NIS maps `group.byname' and `group.bygid',
40 as controlled by
41 .Xr nsswitch.conf 5 .
42 .Pp
43 The file
44 .Nm
45 consists of newline separated
46 .Tn ASCII
47 records, one per group, containing four colon
48 .Ql \&:
49 separated fields.
50 These fields are as follows:
51 .Bl -tag -width password -offset indent -compact
52 .It group
53 Name of the group.
54 .It passwd
55 Group's
56 .Em encrypted
57 password.
58 .It gid
59 The group's decimal ID.
60 .It member
61 Group members.
62 .El
63 .Pp
64 Lines whose first non-whitespace character is a pound-sign (#)
65 are comments, and are ignored.
66 Blank lines that consist
67 only of spaces, tabs or newlines are also ignored.
68 .Pp
69 The
70 .Ar group
71 field is the group name used for granting file access to users
72 who are members of the group.
73 The
74 .Ar gid
75 field is the number associated with the group name.
76 They should both be unique across the system (and often
77 across a group of systems) since they control file access.
78 The
79 .Ar passwd
80 field
81 is an optional
82 .Em encrypted
83 password.
84 This field is rarely used
85 and an asterisk is normally placed in it rather than leaving it blank.
86 The
87 .Ar member
88 field contains the names of users granted the privileges of
89 .Ar group .
90 The member names are separated by commas without spaces or newlines.
91 A user is automatically in a group if that group was specified
92 in their
93 .Pa /etc/passwd
94 entry and does not need to be added to that group in the
95 .Nm
96 file.
97 .\" .Pp
98 .\" When the system reads the file
99 .\" .Pa /etc/group
100 .\" the fields are read into the structure
101 .\" .Fa group
102 .\" declared in
103 .\" .In grp.h :
104 .\" .Bd -literal -offset indent
105 .\" struct group {
106 .\"     char    *gr_name;        /* group name */
107 .\"     char    *gr_passwd;      /* group password */
108 .\"     int     gr_gid;          /* group id */
109 .\"     char    **gr_mem;        /* group members */
110 .\" };
111 .\" .Ed
112 .Sh IMPLEMENTATION NOTES
113 The
114 .Xr passwd 1
115 command does not change the
116 .Nm
117 passwords.
118 The
119 .Xr pw 8
120 utility's
121 .Cm groupmod
122 command should be used instead.
123 .Sh LIMITS
124 There are various limitations which are explained in
125 the function where they occur; see section
126 .Sx SEE ALSO .
127 .Pp
128 In older implementations,
129 a group cannot have more than 200 members.
130 The maximum line length of
131 .Pa /etc/group
132 is 1024 characters.
133 Longer lines will be skipped.
134 This limitation disappeared in
135 .Fx 3.0 .
136 Older binaries that are statically linked, depend on old
137 shared libraries, or
138 .No non- Ns Fx
139 binaries in compatibility mode
140 may still have this limit.
141 .Sh FILES
142 .Bl -tag -width /etc/group -compact
143 .It Pa /etc/group
144 .El
145 .Sh SEE ALSO
146 .Xr newgrp 1 ,
147 .Xr passwd 1 ,
148 .Xr setgroups 2 ,
149 .Xr crypt 3 ,
150 .Xr getgrent 3 ,
151 .Xr initgroups 3 ,
152 .Xr nsswitch.conf 5 ,
153 .Xr passwd 5 ,
154 .Xr chkgrp 8 ,
155 .Xr pw 8 ,
156 .Xr yp 8
157 .Sh HISTORY
158 A
159 .Nm
160 file format appeared in
161 .At v6 .
162 Support for comments first appeared in
163 .Fx 3.0 .