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.\" $Id$ 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 rmuser 37.Op Fl y 38.Op Ar username 39.Sh DESCRIPTION 40The utility 41.Nm rmuser 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 "affirmitively" (i.e., option 91.Fl y 92is not specified), 93.Nm rmuser 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 rmuser 98asks whether you wish to remove the user's home directory and everything 99below. 100.Pp 101As 102.Nm rmuser 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 rmuser 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 rmuser 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 addgroup 8 , 136.Xr adduser 8 , 137.Xr pwd_mkdb 8 , 138.Xr rmgroup 8 , 139.Xr vipw 8 140.Sh HISTORY 141The 142.Nm 143command appeared in 144.Fx 2.2 . 145.\" .Sh AUTHOR 146.\" Guy Helmer, Ames, Iowa 147.Sh BUGS 148.Nm rmuser 149does not comprehensively search the filesystem for all files 150owned by the removed user and remove them; to do so on a system 151of any size is prohibitively slow and I/O intensive. 152.Nm rmuser 153also is unable to remove symbolic links that were created by the 154user in 155.Pa /tmp 156or 157.Pa /var/tmp 158as symbolic links on 4.4BSD filesystems do not contain information 159as to who created them. Also, there may be other files created in 160.Pa /var/mail 161other than 162.Pa /var/mail/username 163and 164.Pa /var/mail/.pop.username 165that are not owned by the removed user but should be removed. 166.Pp 167.Nm rmuser 168has no knowledge of NIS (Yellow Pages), and it operates only on the 169local password file. 170