1.\" $OpenBSD: userdel.8,v 1.10 2003/06/15 06:40:15 jmc Exp $ 2.\" $NetBSD: userdel.8,v 1.24 2003/02/25 10:36:21 wiz Exp $ 3.\" 4.\" Copyright (c) 1999 Alistair G. Crooks. All rights reserved. 5.\" 6.\" Redistribution and use in source and binary forms, with or without 7.\" modification, are permitted provided that the following conditions 8.\" are met: 9.\" 1. Redistributions of source code must retain the above copyright 10.\" notice, this list of conditions and the following disclaimer. 11.\" 2. Redistributions in binary form must reproduce the above copyright 12.\" notice, this list of conditions and the following disclaimer in the 13.\" documentation and/or other materials provided with the distribution. 14.\" 3. All advertising materials mentioning features or use of this software 15.\" must display the following acknowledgement: 16.\" This product includes software developed by Alistair G. Crooks. 17.\" 4. The name of the author may not be used to endorse or promote 18.\" products derived from this software without specific prior written 19.\" permission. 20.\" 21.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS 22.\" OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 23.\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 24.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY 25.\" DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 26.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE 27.\" GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 28.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 29.\" WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 30.\" NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 31.\" SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 32.\" 33.\" 34.Dd November 30, 1999 35.Dt USERDEL 8 36.Os 37.Sh NAME 38.Nm userdel 39.Nd remove a user from the system 40.Sh SYNOPSIS 41.Nm userdel 42.Fl D 43.Op Fl p Ar preserve-value 44.Nm userdel 45.Op Fl prv 46.Ar user 47.Sh DESCRIPTION 48The 49.Nm 50utility removes a user from the system, optionally 51removing that user's home directory and any subdirectories. 52.Pp 53Default values are taken from the information provided in the 54.Pa /etc/usermgmt.conf 55file, which, if running as root, is created using the built-in defaults if 56it does not exist. 57.Pp 58The first form of the command shown above (using the 59.Fl D 60option) sets and displays the defaults for the 61.Nm 62utility. 63.Bl -tag -width Ds 64.It Fl D 65without any further options, 66.Fl D 67will show the current defaults which will be used by the 68.Nm 69utility. 70Together with one of the options shown for the first version 71of the command, 72.Fl D 73will set the default to be the new value. 74.It Fl p Ar preserve-value 75sets the preservation value. 76If this value is one of 77.Ql true , 78.Ql yes , 79or a non-zero number, then the user login information will be preserved. 80.El 81.Pp 82In the second form of the command, 83after setting any defaults, and then reading values from 84.Pa /etc/usermgmt.conf , 85the following command line options are processed: 86.Bl -tag -width Ds 87.It Fl p 88preserve the user information in the password file, 89but do not allow the user to login, by switching the 90password to an 91.Dq impossible 92one, and by setting the 93user's shell to the 94.Xr nologin 8 95program. 96This option can be helpful in preserving a user's 97files for later use by members of that person's 98group after the user has moved on. 99This value can also be set in the 100.Pa /etc/usermgmt.conf 101file, using the 102.Ql preserve 103field. 104If the field has any of the values 105.Ql true , 106.Ql yes , 107or a non-zero number, then user information preservation will take place. 108.It Fl r 109remove the user's home directory, any subdirectories, 110and any files and other entries in them. 111.It Fl v 112perform any actions in a verbose manner. 113.El 114.Pp 115Once the information has been verified, 116.Nm 117uses 118.Xr pwd_mkdb 8 119to update the user database. 120This is run in the background, and, 121at very large sites could take several minutes. 122Until this update is completed, the password file is unavailable for other 123updates and the new information is not available to programs. 124.Pp 125The 126.Nm 127utility exits 0 on success, and \*(Gt0 if an error occurs. 128.Sh FILES 129.Bl -tag -width /etc/usermgmt.conf -compact 130.It Pa /etc/usermgmt.conf 131.El 132.Sh SEE ALSO 133.Xr passwd 5 , 134.Xr usermgmt.conf 5 , 135.Xr nologin 8 , 136.Xr pwd_mkdb 8 137.Sh HISTORY 138The 139.Nm 140utility first appeared in 141.Ox 2.7 . 142.Sh AUTHORS 143The 144.Nm 145utility was written by 146.An Alistair G. Crooks Aq agc@NetBSD.org . 147