xref: /netbsd/usr.sbin/user/userdel.8 (revision c4a72b64)
1.\" $NetBSD: userdel.8,v 1.20 2002/07/08 22:17:47 agc 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
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 (utilising 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. If this value is one of
76.Ql true ,
77.Ql yes ,
78or a non-zero number, then the user login information will be preserved.
79.El
80.Pp
81In the second form of the command,
82after setting any defaults, and then reading values from
83.Pa /etc/usermgmt.conf ,
84the following command line options are processed:
85.Bl -tag -width Ds
86.It Fl p
87preserve the user information in the password file,
88but do not allow the user to login, by switching the
89password to an
90.Dq impossible
91one, and by setting the
92user's shell to the
93.Xr nologin 8
94program. This option can be helpful in preserving a user's
95files for later use by members of that person's
96group after the user has moved on.
97This value can also be set in the
98.Pa /etc/usermgmt.conf
99file, using the
100.Ql preserve
101field. If the field has any of the values
102.Ql true ,
103.Ql yes ,
104or a non-zero number, then user information preservation will take place.
105.It Fl r
106remove the user's home directory, any subdirectories,
107and any files and other entries in them.
108.It Fl v
109perform any actions in a verbose manner.
110.El
111.Pp
112Once the information has been verified,
113.Nm
114uses
115.Xr pwd_mkdb 8
116to update the user database.  This is run in the background, and,
117at very large sites could take several minutes.  Until this update
118is completed, the password file is unavailable for other updates
119and the new information is not available to programs.
120.Pp
121The
122.Nm
123utility exits 0 on success, and \*[Gt]0 if an error occurs.
124.Sh FILES
125.Bl -tag -width /etc/usermgmt.conf -compact
126.It Pa /etc/usermgmt.conf
127.El
128.Sh SEE ALSO
129.Xr passwd 5 ,
130.Xr usermgmt.conf 5 ,
131.Xr nologin 8 ,
132.Xr pwd_mkdb 8
133.Sh HISTORY
134The
135.Nm
136utility first appeared in
137.Nx 1.5 .
138It is based on the
139.Ar addnerd
140package by the same author.
141.Sh AUTHORS
142The
143.Nm
144utility was written by Alistair G. Crooks (agc@netbsd.org).
145