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