Initial import from FreeBSD RELENG_4:
[games.git] / usr.sbin / pw / pw.conf.5
1 .\" Copyright (C) 1996
2 .\" David L. Nugent.  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 .\"
13 .\" THIS SOFTWARE IS PROVIDED BY DAVID L. NUGENT AND CONTRIBUTORS ``AS IS'' AND
14 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16 .\" ARE DISCLAIMED.  IN NO EVENT SHALL DAVID L. NUGENT OR CONTRIBUTORS BE LIABLE
17 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
23 .\" SUCH DAMAGE.
24 .\"
25 .\" $FreeBSD: src/usr.sbin/pw/pw.conf.5,v 1.10.2.3 2001/07/22 12:41:27 dd Exp $
26 .\"
27 .Dd December 9, 1996
28 .Dt PW.CONF 5
29 .Os
30 .Sh NAME
31 .Nm pw.conf
32 .Nd format of the pw.conf configuration file
33 .Sh DESCRIPTION
34 The file
35 .Aq Pa /etc/pw.conf
36 contains configuration data for the
37 .Xr pw 8
38 program.
39 The
40 .Xr pw 8
41 program is used for maintenance of the system password and group
42 files, allowing users and groups to be added, deleted and changed.
43 This file may be modified via the
44 .Xr pw 8
45 command using the
46 .Ar useradd
47 command and the
48 .Fl D
49 option, or by editing it directly with a text editor.
50 .Pp
51 Each line in
52 .Aq Pa /etc/pw.conf
53 is treated either a comment or as configuration data;
54 blank lines and lines commencing with a
55 .Ql \&#
56 character are considered comments, and any remaining lines are
57 examined for a leading keyword, followed by corresponding data.
58 .Pp
59 Keywords recognized by
60 .Xr pw 8
61 are:
62 .Bl -tag -width password_days -offset indent -compact
63 .It defaultpasswd
64 affect passwords generated for new users
65 .It reuseuids
66 reuse gaps in uid sequences
67 .It reusegids
68 reuse gaps in gid sequences
69 .It nispasswd
70 path to the NIS passwd database
71 .It skeleton
72 where to obtain default home contents
73 .It newmail
74 mail to send to new users
75 .It logfile
76 log user/group modifications to this file
77 .It home
78 root directory for home directories
79 .It shellpath
80 paths in which to locate shell programs
81 .It shells
82 list of valid shells (without path)
83 .It defaultshell
84 default shell (without path)
85 .It defaultgroup
86 default group
87 .It extragroups
88 add new users to this groups
89 .It defaultclass
90 place new users in this login class
91 .It minuid
92 .It maxuid
93 range of valid default user ids
94 .It mingid
95 .It maxgid
96 range of valid default group ids
97 .It expire_days
98 days after which account expires
99 .It password_days
100 days after which password expires
101 .El
102 .Pp
103 Valid values for
104 .Ar defaultpasswd
105 are:
106 .Bl -tag -width password_days -offset indent -compact
107 .It no
108 disable login on newly created accounts
109 .It yes
110 force the password to be the account name
111 .It none
112 force a blank password
113 .It random
114 generate a random password
115 .El
116 .Pp
117 The second and third options are insecure and should be avoided if
118 possible on a publicly accessible system.
119 The first option requires that the superuser run
120 .Xr passwd 1
121 to set a password before the account may be used.
122 This may also be useful for creating administrative accounts.
123 The final option causes
124 .Xr pw 8
125 to respond by printing a randomly generated password on stdout.
126 This is the preferred and most secure option.
127 .Xr Pw 8
128 also provides a method of setting a specific password for the new
129 user via a filehandle (command lines are not secure).
130 .Pp
131 Both
132 .Ar reuseuids
133 and
134 .Ar reusegids
135 determine the method by which new user and group id numbers are
136 generated.
137 A
138 .Ql \&yes
139 in this field will cause
140 .Xr pw 8
141 to search for the first unused user or group id within the allowed
142 range, whereas a
143 .Ql \&no
144 will ensure that no other existing user or group id within the range
145 is numerically lower than the new one generated, and therefore avoids
146 reusing gaps in the user or group id sequence that are caused by
147 previous user or group deletions.
148 Note that if the default group is not specified using the
149 .Ar defaultgroup
150 keyword,
151 .Xr pw 8
152 will create a new group for the user and attempt to keep the new
153 user's uid and gid the same.
154 If the new user's uid is currently in use as a group id, then the next
155 available group id is chosen instead.
156 .Pp
157 On NIS servers which maintain a separate passwd database to
158 .Pa /etc/master.passwd ,
159 this option allows the additional file to be concurrently updated
160 as user records are added, modified or removed.
161 If blank or set to 'no', no additional database is updated.
162 An absolute pathname must be used.
163 .Pp
164 The
165 .Ar skeleton
166 keyword nominates a directory from which the contents of a user's
167 new home directory is constructed.
168 This is
169 .Pa /usr/share/skel
170 by default.
171 .Xr Pw 8 Ns 's
172 .Fl m
173 option causes the user's home directory to be created and populated
174 using the files contained in the
175 .Ar skeleton
176 directory.
177 .Pp
178 To send an initial email to new users, the
179 .Ar newmail
180 keyword may be used to specify a path name to a file containing
181 the message body of the message to be sent.
182 To avoid sending mail when accounts are created, leave this entry
183 blank or specify
184 .Ql \&no .
185 .Pp
186 The
187 .Ar logfile
188 option allows logging of password file modifications into the
189 nominated log file.
190 To avoid creating or adding to such a logfile, then leave this
191 field blank or specify
192 .Ql \&no .
193 .Pp
194 The
195 .Ar home
196 keyword is mandatory.
197 This specifies the location of the directory in which all new user
198 home directories are created.
199 .Pp
200 .Ar shellpath
201 specifies a list of directories - separated by colons
202 .Ql \&:
203 - which contain the programs used by the login shells.
204 .Pp
205 The
206 .Ar shells
207 keyword specifies a list of programs available for use as login
208 shells.
209 This list is a comma-separated list of shell names which should
210 not contain a path.
211 These shells must exist in one of the directories nominated by
212 .Ar shellpath .
213 .Pp
214 The
215 .Ar defaultshell
216 keyword nominates which shell program to use for new users when
217 none is specified on the
218 .Xr pw 8
219 command line.
220 .Pp
221 The
222 .Ar defaultgroup
223 keyword defines the primary group (the group id number in the
224 password file) used for new accounts.
225 If left blank, or the word
226 .Ql \&no
227 is used, then each new user will have a corresponding group of
228 their own created automatically.
229 This is the recommended procedure for new users as it best secures each
230 user's files against interference by other users of the system
231 irrespective of the
232 .Em umask
233 normally used by the user.
234 .Pp
235 .Ar extragroups
236 provides an automatic means of placing new users into groups within
237 the
238 .Pa /etc/groups
239 file.
240 This is useful where all users share some resources, and is preferable
241 to placing users into the same primary group.
242 The effect of this keyword can be overridden using the
243 .Fl G
244 option on the
245 .Xr pw 8
246 command line.
247 .Pp
248 The
249 .Ar defaultclass
250 field determines the login class (See
251 .Xr login.conf 5 )
252 that new users will be allocated unless overwritten by
253 .Xr pw 8 .
254 .Pp
255 The
256 .Ar minuid ,
257 .Ar maxuid ,
258 .Ar mingid ,
259 .Ar maxgid
260 keywords determines the allowed ranges of automatically allocated user
261 and group id numbers.
262 The default values for both user and group ids are 1000 and 32000 as
263 minimum and maximum respectively.
264 The user and group id's actually used when creating an account with
265 .Xr pw 8
266 may be overridden using the
267 .Fl u
268 and
269 .Fl g
270 command line options.
271 .Pp
272 The
273 .Ar expire_days
274 and
275 .Ar password_days
276 are used to automatically calculate the number of days from the date
277 on which an account is created when the account will expire or the
278 user will be forced to change the account's password.
279 A value of
280 .Ql \&0
281 in either field will disable the corresponding (account or password)
282 expiration date.
283 .Sh LIMITS
284 The maximum line length of
285 .Pa /etc/pw.conf
286 is 1024 characters.
287 Longer lines will be skipped and treated
288 as comments.
289 .Sh FILES
290 .Bl -tag -width /etc/master.passwd -compact
291 .It Pa /etc/pw.conf
292 .It Pa /etc/passwd
293 .It Pa /etc/master.passwd
294 .It Pa /etc/group
295 .El
296 .Sh SEE ALSO
297 .Xr passwd 1 ,
298 .Xr group 5 ,
299 .Xr login.conf 5 ,
300 .Xr passwd 5 ,
301 .Xr pw 8