Initial import from FreeBSD RELENG_4:
[dragonfly.git] / usr.sbin / adduser / rmuser.8
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 .\"
29 .Dd February 23, 1997
30 .Dt RMUSER 8
31 .Os
32 .Sh NAME
33 .Nm rmuser
34 .Nd removes users from the system
35 .Sh SYNOPSIS
36 .Nm
37 .Op Fl y
38 .Op Ar username
39 .Sh DESCRIPTION
40 The utility
41 .Nm
42 .Pp
43 .Bl -enum
44 .It
45 Removes the user's
46 .Xr crontab 1
47 entry (if any).
48 .It
49 Removes any
50 .Xr at 1
51 jobs belonging to the user.
52 .It
53 Sends a
54 .Dv SIGKILL
55 signal to all processes owned by the user.
56 .It
57 Removes the user from the system's local password file.
58 .It
59 Removes the user's home directory (if it is owned by the user),
60 including handling of symbolic links in the path to the actual home
61 directory.
62 .It
63 Removes the incoming mail and POP daemon mail files belonging to the
64 user from
65 .Pa /var/mail .
66 .It
67 Removes all files owned by the user from
68 .Pa /tmp , /var/tmp ,
69 and
70 .Pa /var/tmp/vi.recover .
71 .It
72 Removes the username from all groups to which it belongs in
73 .Pa /etc/group .
74 (If a group becomes empty and the group name is the same as the username,
75 the group is removed; this complements
76 .Xr adduser 8 Ns 's
77 per-user unique groups).
78 .El
79 .Pp
80 .Nm Rmuser
81 politely refuses to remove users whose uid is 0 (typically root), since
82 certain actions (namely, killing all the user's processes, and perhaps
83 removing the user's home directory) would cause damage to a running system.
84 If it is necessary to remove a user whose uid is 0, see
85 .Xr vipw 8
86 for information on directly editing the password file, by which the desired
87 user's
88 .Xr passwd 5
89 entry may be removed manually.
90 .Pp
91 If not running "affirmatively" (i.e., option
92 .Fl y
93 is not specified),
94 .Nm
95 shows the selected user's password file entry and asks for confirmation
96 that you wish to remove the user.  If the user's home directory is owned
97 by the user,
98 .Nm
99 asks whether you wish to remove the user's home directory and everything
100 below.
101 .Pp
102 As
103 .Nm
104 operates, it informs the user regarding the current activity.  If any
105 errors occur, they are posted to standard error and, if it is possible for
106 .Nm
107 to continue, it will.
108 .Pp
109 Available options:
110 .Pp
111 .Bl -tag -width username
112 .It Fl y
113 Affirm - any question that would be asked is answered implicitly in
114 the affirmative (i.e., yes).  A username must also be specified on the
115 command line if this option is used.
116 .It Ar \&username
117 Identifies the user to be removed; if not present,
118 .Nm
119 interactively asks for the user to be removed.
120 .El
121 .Sh FILES
122 .Bl -tag -width /etc/master.passwd -compact
123 .It Pa /etc/master.passwd
124 .It Pa /etc/passwd
125 .It Pa /etc/group
126 .It Pa /etc/spwd.db
127 .It Pa /etc/pwd.db
128 .El
129 .Sh SEE ALSO
130 .Xr at 1 ,
131 .Xr chpass 1 ,
132 .Xr crontab 1 ,
133 .Xr finger 1 ,
134 .Xr passwd 1 ,
135 .Xr group 5 ,
136 .Xr passwd 5 ,
137 .Xr adduser 8 ,
138 .Xr pw 8 ,
139 .Xr pwd_mkdb 8 ,
140 .Xr vipw 8
141 .Sh HISTORY
142 The
143 .Nm
144 utility appeared in
145 .Fx 2.2 .
146 .Sh BUGS
147 The
148 .Nm
149 utility does not comprehensively search the file system for all files
150 owned by the removed user and remove them; to do so on a system
151 of any size is prohibitively slow and I/O intensive.
152 It is also unable to remove symbolic links that were created by the
153 user in
154 .Pa /tmp
155 or
156 .Pa /var/tmp ,
157 as symbolic links on
158 .Bx 4.4
159 file systems do not contain information
160 as to who created them.
161 Also, there may be other files created in
162 .Pa /var/mail
163 other than
164 .Pa /var/mail/ Ns Ar username
165 and
166 .Pa /var/mail/.pop. Ns Ar username
167 that are not owned by the removed user but should be removed.
168 .Pp
169 The
170 .Nm
171 utility has no knowledge of YP/NIS, and it operates only on the
172 local password file.