]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - usr.sbin/vipw/vipw.8
bsdinstall/distfetch.c: check environment variables before downloading and handle...
[FreeBSD/FreeBSD.git] / usr.sbin / vipw / vipw.8
1 .\" Copyright (c) 1983, 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 November 12, 2022
29 .Dt VIPW 8
30 .Os
31 .Sh NAME
32 .Nm vipw
33 .Nd edit the password file
34 .Sh SYNOPSIS
35 .Nm
36 .Op Fl d Ar directory
37 .Sh DESCRIPTION
38 The
39 .Nm
40 utility edits the password file after setting the appropriate locks,
41 and does any necessary processing after the password file is unlocked.
42 If the password file is already locked for editing by another user,
43 .Nm
44 will ask you
45 to try again later.
46 The default editor for
47 .Nm
48 is
49 .Xr vi 1 .
50 .Pp
51 When run without options,
52 .Nm
53 will work with the password files in
54 .Pa /etc .
55 The
56 .Fl d
57 option may be used to specify an alternative
58 .Ar directory
59 to work with.
60 .Pp
61 The
62 .Nm
63 utility performs a number of consistency checks on the password entries,
64 and will not allow a password file with a
65 .Dq mangled
66 entry to be
67 installed.
68 If
69 .Nm
70 rejects the new password file, the user is prompted to re-enter
71 the edit session.
72 .Pp
73 Once the information has been verified,
74 .Nm
75 uses
76 .Xr pwd_mkdb 8
77 to update the user database.
78 This is run in the background, and,
79 at very large sites could take several minutes.
80 Until this update
81 is completed, the password file is unavailable for other updates
82 and the new information is not available to programs.
83 .Sh ENVIRONMENT
84 If the following environment variable exists it will be utilized by
85 .Nm :
86 .Bl -tag -width PW_SCAN_BIG_IDS
87 .It Ev EDITOR
88 The editor specified by the string
89 .Ev EDITOR
90 will be invoked instead of the default editor
91 .Xr vi 1 .
92 This can be used to allow a script to non-interactively modify the
93 password file.
94 .It Ev PW_SCAN_BIG_IDS
95 See
96 .Xr pwd_mkdb 8 .
97 .El
98 .Sh FILES
99 .Bl -tag -width "/etc/master.passwdXXX" -compact
100 .It Pa /etc/master.passwd
101 Current password file.
102 .It Pa /etc/passwd
103 Legacy password file.
104 .It Pa /etc/ptmp
105 Password lock file.
106 .It Pa /etc/pwd.db
107 Insecure password database file.
108 .It Pa /etc/spwd.db
109 Secure password database file.
110 .El
111 .Sh SEE ALSO
112 .Xr chpass 1 ,
113 .Xr passwd 1 ,
114 .Xr passwd 5 ,
115 .Xr adduser 8 ,
116 .Xr pw 8 ,
117 .Xr pwd_mkdb 8
118 .Sh HISTORY
119 The
120 .Nm
121 utility appeared in
122 .Bx 4.0 .
123 .Sh BUGS
124 The mechanism for checking for password file modifications requires that
125 the modification time of the password file changes.
126 This means that in a default configuration where file system timestamps
127 are not calculated with sub-second precision,
128 .Ev EDITOR
129 has to run for at least one second.
130 Non-interactive editor scripts should invoke
131 .Xr sleep 1
132 or equivalent to ensure this happens.