xref: /netbsd/usr.sbin/user/userdel.8 (revision bf9ec67e)
1.\" $NetBSD: userdel.8,v 1.14 2002/02/08 01:38:57 ross Exp $ */
2.\"
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 ""
42.Fl D
43.Op Fl p Ar preserve-value
44.Nm ""
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 diretory and any subdirectories.
52.Pp
53The first format of the command shown above (utilising the -D option)
54sets and displays the defaults for the
55.Nm
56utility.
57.Bl -tag -width Ds
58.It Fl D
59without any further options,
60.Fl D
61will show the current defaults which will be used by the
62.Nm
63utility. Together with one of the options shown for the first version
64of the command,
65.Fl D
66will set the default to be the new value.
67.It Fl p Ar preserve-value
68sets the preservation value. If this value is one of
69.Ql true ,
70.Ql yes ,
71or a non-zero number, then the user login information will be preserved.
72.El
73.Pp
74The following command line options are recognised:
75.Bl -tag -width Ds
76.It Fl p
77preserve the user information in the password file,
78but do not allow the user to login, by switching the
79password to an
80.Dq impossible
81one, and by setting the
82user's shell to the
83.Xr nologin 8
84program. This option can be helpful in preserving a user's
85files for later use by members of that person's
86group after the user has moved on.
87This value can also be set in the
88.Pa /etc/usermgmt.conf
89file, using the
90.Ql preserve
91field. If the field has any of the values
92.Ql true ,
93.Ql yes ,
94or a non-zero number, then user information preservation will take place.
95.It Fl r
96remove the user's home directory, any subdirectories,
97and any files and other entries in them.
98.It Fl v
99perform any actions in a verbose manner.
100.El
101.Pp
102Once the information has been verified,
103.Nm
104uses
105.Xr pwd_mkdb 8
106to update the user database.  This is run in the background, and,
107at very large sites could take several minutes.  Until this update
108is completed, the password file is unavailable for other updates
109and the new information is not available to programs.
110.Pp
111The
112.Nm
113utility exits 0 on success, and \*[Gt]0 if an error occurs.
114.Sh FILES
115.Bl -tag -width /etc/usermgmt.conf -compact
116.It Pa /etc/usermgmt.conf
117.El
118.Sh SEE ALSO
119.Xr passwd 5 ,
120.Xr nologin 8 ,
121.Xr pwd_mkdb 8
122.Sh HISTORY
123The
124.Nm
125utility first appeared in
126.Nx 1.5 .
127It is based on the
128.Ar addnerd
129package by the same author.
130.Sh AUTHORS
131The
132.Nm
133utility was written by Alistair G. Crooks (agc@netbsd.org).
134