1dea673e9SRodney W. Grimes.\" Copyright (c) 1983, 1991, 1993 2dea673e9SRodney W. Grimes.\" The Regents of the University of California. All rights reserved. 3dea673e9SRodney W. Grimes.\" 4dea673e9SRodney W. Grimes.\" Redistribution and use in source and binary forms, with or without 5dea673e9SRodney W. Grimes.\" modification, are permitted provided that the following conditions 6dea673e9SRodney W. Grimes.\" are met: 7dea673e9SRodney W. Grimes.\" 1. Redistributions of source code must retain the above copyright 8dea673e9SRodney W. Grimes.\" notice, this list of conditions and the following disclaimer. 9dea673e9SRodney W. Grimes.\" 2. Redistributions in binary form must reproduce the above copyright 10dea673e9SRodney W. Grimes.\" notice, this list of conditions and the following disclaimer in the 11dea673e9SRodney W. Grimes.\" documentation and/or other materials provided with the distribution. 12fbbd9655SWarner Losh.\" 3. Neither the name of the University nor the names of its contributors 13dea673e9SRodney W. Grimes.\" may be used to endorse or promote products derived from this software 14dea673e9SRodney W. Grimes.\" without specific prior written permission. 15dea673e9SRodney W. Grimes.\" 16dea673e9SRodney W. Grimes.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 17dea673e9SRodney W. Grimes.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18dea673e9SRodney W. Grimes.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 19dea673e9SRodney W. Grimes.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 20dea673e9SRodney W. Grimes.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21dea673e9SRodney W. Grimes.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 22dea673e9SRodney W. Grimes.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 23dea673e9SRodney W. Grimes.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 24dea673e9SRodney W. Grimes.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 25dea673e9SRodney W. Grimes.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 26dea673e9SRodney W. Grimes.\" SUCH DAMAGE. 27dea673e9SRodney W. Grimes.\" 28*30a6c8a3SGordon Bergling.Dd November 12, 2022 29dea673e9SRodney W. Grimes.Dt VIPW 8 30a4c37c81SRuslan Ermilov.Os 31dea673e9SRodney W. Grimes.Sh NAME 32dea673e9SRodney W. Grimes.Nm vipw 33dea673e9SRodney W. Grimes.Nd edit the password file 34dea673e9SRodney W. Grimes.Sh SYNOPSIS 35e97407b4SRuslan Ermilov.Nm 36af2d5f9bSSheldon Hearn.Op Fl d Ar directory 37dea673e9SRodney W. Grimes.Sh DESCRIPTION 38490d5836SPhilippe CharnierThe 39490d5836SPhilippe Charnier.Nm 40490d5836SPhilippe Charnierutility edits the password file after setting the appropriate locks, 41dea673e9SRodney W. Grimesand does any necessary processing after the password file is unlocked. 42dea673e9SRodney W. GrimesIf the password file is already locked for editing by another user, 43acb61b9eSPhilippe Charnier.Nm 44dea673e9SRodney W. Grimeswill ask you 45f2e366a1SSheldon Hearnto try again later. 46f2e366a1SSheldon HearnThe default editor for 47acb61b9eSPhilippe Charnier.Nm 48dea673e9SRodney W. Grimesis 49dea673e9SRodney W. Grimes.Xr vi 1 . 50dea673e9SRodney W. Grimes.Pp 51af2d5f9bSSheldon HearnWhen run without options, 52e97407b4SRuslan Ermilov.Nm 53af2d5f9bSSheldon Hearnwill work with the password files in 54af2d5f9bSSheldon Hearn.Pa /etc . 55af2d5f9bSSheldon HearnThe 56af2d5f9bSSheldon Hearn.Fl d 57af2d5f9bSSheldon Hearnoption may be used to specify an alternative 58af2d5f9bSSheldon Hearn.Ar directory 59af2d5f9bSSheldon Hearnto work with. 60af2d5f9bSSheldon Hearn.Pp 61490d5836SPhilippe CharnierThe 62490d5836SPhilippe Charnier.Nm 63490d5836SPhilippe Charnierutility performs a number of consistency checks on the password entries, 64dea673e9SRodney W. Grimesand will not allow a password file with a 65dea673e9SRodney W. Grimes.Dq mangled 66dea673e9SRodney W. Grimesentry to be 67dea673e9SRodney W. Grimesinstalled. 68dea673e9SRodney W. GrimesIf 69acb61b9eSPhilippe Charnier.Nm 70dea673e9SRodney W. Grimesrejects the new password file, the user is prompted to re-enter 71dea673e9SRodney W. Grimesthe edit session. 72dea673e9SRodney W. Grimes.Pp 73dea673e9SRodney W. GrimesOnce the information has been verified, 74acb61b9eSPhilippe Charnier.Nm 75dea673e9SRodney W. Grimesuses 76dea673e9SRodney W. Grimes.Xr pwd_mkdb 8 7707bfccd7SRuslan Ermilovto update the user database. 7807bfccd7SRuslan ErmilovThis is run in the background, and, 7907bfccd7SRuslan Ermilovat very large sites could take several minutes. 8007bfccd7SRuslan ErmilovUntil this update 81dea673e9SRodney W. Grimesis completed, the password file is unavailable for other updates 82dea673e9SRodney W. Grimesand the new information is not available to programs. 83dea673e9SRodney W. Grimes.Sh ENVIRONMENT 84dea673e9SRodney W. GrimesIf the following environment variable exists it will be utilized by 85e97407b4SRuslan Ermilov.Nm : 869a602accSSheldon Hearn.Bl -tag -width PW_SCAN_BIG_IDS 87dea673e9SRodney W. Grimes.It Ev EDITOR 88dea673e9SRodney W. GrimesThe editor specified by the string 89dea673e9SRodney W. Grimes.Ev EDITOR 90dea673e9SRodney W. Grimeswill be invoked instead of the default editor 91dea673e9SRodney W. Grimes.Xr vi 1 . 92f9d8d64fSBrooks DavisThis can be used to allow a script to non-interactively modify the 93f9d8d64fSBrooks Davispassword file. 949a602accSSheldon Hearn.It Ev PW_SCAN_BIG_IDS 959a602accSSheldon HearnSee 969a602accSSheldon Hearn.Xr pwd_mkdb 8 . 97dea673e9SRodney W. Grimes.El 98*30a6c8a3SGordon Bergling.Sh FILES 99*30a6c8a3SGordon Bergling.Bl -tag -width "/etc/master.passwdXXX" -compact 100*30a6c8a3SGordon Bergling.It Pa /etc/master.passwd 101*30a6c8a3SGordon BerglingCurrent password file. 102*30a6c8a3SGordon Bergling.It Pa /etc/passwd 103*30a6c8a3SGordon BerglingLegacy password file. 104*30a6c8a3SGordon Bergling.It Pa /etc/ptmp 105*30a6c8a3SGordon BerglingPassword lock file. 106*30a6c8a3SGordon Bergling.It Pa /etc/pwd.db 107*30a6c8a3SGordon BerglingInsecure password database file. 108*30a6c8a3SGordon Bergling.It Pa /etc/spwd.db 109*30a6c8a3SGordon BerglingSecure password database file. 110*30a6c8a3SGordon Bergling.El 111dea673e9SRodney W. Grimes.Sh SEE ALSO 112dea673e9SRodney W. Grimes.Xr chpass 1 , 113dea673e9SRodney W. Grimes.Xr passwd 1 , 114dea673e9SRodney W. Grimes.Xr passwd 5 , 115dea673e9SRodney W. Grimes.Xr adduser 8 , 11671997d4bSSean Chittenden.Xr pw 8 , 117dea673e9SRodney W. Grimes.Xr pwd_mkdb 8 118dea673e9SRodney W. Grimes.Sh HISTORY 119dea673e9SRodney W. GrimesThe 120dea673e9SRodney W. Grimes.Nm 121490d5836SPhilippe Charnierutility appeared in 122dea673e9SRodney W. Grimes.Bx 4.0 . 1236bbd04d0SEd Schouten.Sh BUGS 1246bbd04d0SEd SchoutenThe mechanism for checking for password file modifications requires that 1256bbd04d0SEd Schoutenthe modification time of the password file changes. 1266bbd04d0SEd SchoutenThis means that in a default configuration where file system timestamps 1276bbd04d0SEd Schoutenare not calculated with sub-second precision, 1286bbd04d0SEd Schouten.Ev EDITOR 1296bbd04d0SEd Schoutenhas to run for at least one second. 1306bbd04d0SEd SchoutenNon-interactive editor scripts should invoke 1316bbd04d0SEd Schouten.Xr sleep 1 1326bbd04d0SEd Schoutenor equivalent to ensure this happens. 133