xref: /dragonfly/usr.sbin/adduser/rmuser.8 (revision 6e285212)
1.\" Copyright 1995, 1996, 1997
2.\"     Guy Helmer, Ames, Iowa 50014.  All rights reserved.
3.\"
4.\" Redistribution and use in source and binary forms, with or without
5.\" modification, are permitted provided that the following conditions
6.\" are met:
7.\" 1. Redistributions of source code must retain the above copyright
8.\"    notice, this list of conditions and the following disclaimer as
9.\"    the first lines of this file unmodified.
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 products
14.\"    derived from this software without specific prior written permission.
15.\"
16.\" THIS SOFTWARE IS PROVIDED BY GUY HELMER ``AS IS'' AND ANY EXPRESS OR
17.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
18.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
19.\" IN NO EVENT SHALL GUY HELMER BE LIABLE FOR ANY DIRECT, INDIRECT,
20.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
21.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
22.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
23.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
25.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26.\"
27.\" $FreeBSD: src/usr.sbin/adduser/rmuser.8,v 1.10.2.6 2003/03/13 03:10:59 trhodes Exp $
28.\" $DragonFly: src/usr.sbin/adduser/rmuser.8,v 1.2 2003/06/17 04:29:52 dillon Exp $
29.\"
30.Dd February 23, 1997
31.Dt RMUSER 8
32.Os
33.Sh NAME
34.Nm rmuser
35.Nd removes users from the system
36.Sh SYNOPSIS
37.Nm
38.Op Fl y
39.Op Ar username
40.Sh DESCRIPTION
41The utility
42.Nm
43.Pp
44.Bl -enum
45.It
46Removes the user's
47.Xr crontab 1
48entry (if any).
49.It
50Removes any
51.Xr at 1
52jobs belonging to the user.
53.It
54Sends a
55.Dv SIGKILL
56signal to all processes owned by the user.
57.It
58Removes the user from the system's local password file.
59.It
60Removes the user's home directory (if it is owned by the user),
61including handling of symbolic links in the path to the actual home
62directory.
63.It
64Removes the incoming mail and POP daemon mail files belonging to the
65user from
66.Pa /var/mail .
67.It
68Removes all files owned by the user from
69.Pa /tmp , /var/tmp ,
70and
71.Pa /var/tmp/vi.recover .
72.It
73Removes the username from all groups to which it belongs in
74.Pa /etc/group .
75(If a group becomes empty and the group name is the same as the username,
76the group is removed; this complements
77.Xr adduser 8 Ns 's
78per-user unique groups).
79.El
80.Pp
81.Nm Rmuser
82politely refuses to remove users whose uid is 0 (typically root), since
83certain actions (namely, killing all the user's processes, and perhaps
84removing the user's home directory) would cause damage to a running system.
85If it is necessary to remove a user whose uid is 0, see
86.Xr vipw 8
87for information on directly editing the password file, by which the desired
88user's
89.Xr passwd 5
90entry may be removed manually.
91.Pp
92If not running "affirmatively" (i.e., option
93.Fl y
94is not specified),
95.Nm
96shows the selected user's password file entry and asks for confirmation
97that you wish to remove the user.  If the user's home directory is owned
98by the user,
99.Nm
100asks whether you wish to remove the user's home directory and everything
101below.
102.Pp
103As
104.Nm
105operates, it informs the user regarding the current activity.  If any
106errors occur, they are posted to standard error and, if it is possible for
107.Nm
108to continue, it will.
109.Pp
110Available options:
111.Pp
112.Bl -tag -width username
113.It Fl y
114Affirm - any question that would be asked is answered implicitly in
115the affirmative (i.e., yes).  A username must also be specified on the
116command line if this option is used.
117.It Ar \&username
118Identifies the user to be removed; if not present,
119.Nm
120interactively asks for the user to be removed.
121.El
122.Sh FILES
123.Bl -tag -width /etc/master.passwd -compact
124.It Pa /etc/master.passwd
125.It Pa /etc/passwd
126.It Pa /etc/group
127.It Pa /etc/spwd.db
128.It Pa /etc/pwd.db
129.El
130.Sh SEE ALSO
131.Xr at 1 ,
132.Xr chpass 1 ,
133.Xr crontab 1 ,
134.Xr finger 1 ,
135.Xr passwd 1 ,
136.Xr group 5 ,
137.Xr passwd 5 ,
138.Xr adduser 8 ,
139.Xr pw 8 ,
140.Xr pwd_mkdb 8 ,
141.Xr vipw 8
142.Sh HISTORY
143The
144.Nm
145utility appeared in
146.Fx 2.2 .
147.Sh BUGS
148The
149.Nm
150utility does not comprehensively search the file system for all files
151owned by the removed user and remove them; to do so on a system
152of any size is prohibitively slow and I/O intensive.
153It is also unable to remove symbolic links that were created by the
154user in
155.Pa /tmp
156or
157.Pa /var/tmp ,
158as symbolic links on
159.Bx 4.4
160file systems do not contain information
161as to who created them.
162Also, there may be other files created in
163.Pa /var/mail
164other than
165.Pa /var/mail/ Ns Ar username
166and
167.Pa /var/mail/.pop. Ns Ar username
168that are not owned by the removed user but should be removed.
169.Pp
170The
171.Nm
172utility has no knowledge of YP/NIS, and it operates only on the
173local password file.
174