1 .\" Copyright 1995, 1996, 1997
2 .\" Guy Helmer, Ames, Iowa 50014. All rights reserved.
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
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.
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.
27 .\" $FreeBSD: src/usr.sbin/adduser/rmuser.8,v 1.23 2004/06/08 14:52:55 csjp Exp $
28 .\" $DragonFly: src/usr.sbin/adduser/rmuser.8,v 1.4 2007/05/17 08:19:03 swildner Exp $
35 .Nd remove users from the system
44 utility removes one or more users submitted on the command line
46 In removing a user from the system, this utility:
55 jobs belonging to the user.
59 signal to all processes owned by the user.
61 Removes the user from the system's local password file.
63 Removes the user's home directory (if it is owned by the user),
64 including handling of symbolic links in the path to the actual home
67 Removes the incoming mail and POP daemon mail files belonging to the
71 Removes all files owned by the user from
74 .Pa /var/tmp/vi.recover .
76 Removes the username from all groups to which it belongs in
78 (If a group becomes empty and the group name is the same as the username,
79 the group is removed; this complements
81 per-user unique groups.)
83 Removes all message queues, shared memory segments and
84 semaphores owned by the user.
89 utility refuses to remove users whose UID is 0 (typically root), since
90 certain actions (namely, killing all the user's processes, and perhaps
91 removing the user's home directory) would cause damage to a running system.
92 If it is necessary to remove a user whose UID is 0, see
94 for information on directly editing the password file.
98 was not invoked with the
101 show the selected user's password file entry and ask for confirmation
102 that the user be removed.
103 It will then ask for confirmation to delete
104 the user's home directory.
105 If the answer is in the affirmative, the home
106 directory and any files and subdirectories under it will be deleted only if
107 they are owned by the user.
114 operates, it informs the user regarding the current activity.
116 errors occur, they are posted to standard error and, if it is possible for
118 to continue, it will.
120 The options are as follows:
121 .Bl -tag -width ".Ar username"
125 utility will get a list of users to be removed from
127 which will contain one user per line.
128 Anything following a hash mark
130 including the hash mark itself, is considered a comment and will not
132 If the file is owned by anyone other than a user with
133 UID 0, or is writeable by anyone other than the owner,
135 will refuse to continue.
139 to any and all prompts.
140 Currently, this includes
141 prompts on whether to remove the specified user and whether to remove
143 This option requires that either the
145 option be used, or one or more user names be given as command line
150 the output includes one line per removed user;
154 will be much more chatty about the steps taken.
156 Identifies one or more users to be removed; if not present,
158 interactively asks for one or more users to be removed.
162 .It Pa /etc/master.passwd
188 utility does not comprehensively search the file system for all files
189 owned by the removed user and remove them; to do so on a system
190 of any size is prohibitively slow and I/O intensive.
191 It is also unable to remove symbolic links that were created by the
198 file systems do not contain information
199 as to who created them.
200 Also, there may be other files created in
203 .Pa /var/mail/ Ns Ar username
205 .Pa /var/mail/.pop. Ns Ar username
206 that are not owned by the removed user but should be removed.
210 utility has no knowledge of YP/NIS, and it operates only on the