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