1997-03-08 18:04:45 +00:00
|
|
|
.\" Copyright 1995, 1996, 1997
|
|
|
|
.\" Guy Helmer, Ames, Iowa 50014. All rights reserved.
|
1996-11-17 03:51:33 +00:00
|
|
|
.\"
|
|
|
|
.\" Redistribution and use in source and binary forms, with or without
|
|
|
|
.\" modification, are permitted provided that the following conditions
|
|
|
|
.\" are met:
|
|
|
|
.\" 1. Redistributions of source code must retain the above copyright
|
|
|
|
.\" notice, this list of conditions and the following disclaimer as
|
|
|
|
.\" the first lines of this file unmodified.
|
|
|
|
.\" 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
.\" notice, this list of conditions and the following disclaimer in the
|
|
|
|
.\" documentation and/or other materials provided with the distribution.
|
|
|
|
.\" 3. The name of the author may not be used to endorse or promote products
|
|
|
|
.\" derived from this software without specific prior written permission.
|
|
|
|
.\"
|
|
|
|
.\" THIS SOFTWARE IS PROVIDED BY GUY HELMER ``AS IS'' AND ANY EXPRESS OR
|
|
|
|
.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
|
|
|
.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
|
|
|
.\" IN NO EVENT SHALL GUY HELMER BE LIABLE FOR ANY DIRECT, INDIRECT,
|
|
|
|
.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
|
|
|
.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
|
|
.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
|
|
.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
|
|
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
|
|
|
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
.\"
|
1997-02-22 16:15:28 +00:00
|
|
|
.\" $Id$
|
1996-11-17 03:51:33 +00:00
|
|
|
.\"
|
1997-03-08 18:04:45 +00:00
|
|
|
.Dd February 23, 1997
|
1996-11-17 03:51:33 +00:00
|
|
|
.Dt RMUSER 8
|
|
|
|
.Os
|
|
|
|
.Sh NAME
|
|
|
|
.Nm rmuser
|
1997-03-08 18:04:45 +00:00
|
|
|
.Nd removes users from the system
|
1996-11-17 03:51:33 +00:00
|
|
|
.Sh SYNOPSIS
|
|
|
|
.Nm rmuser
|
1997-03-08 18:04:45 +00:00
|
|
|
.Op Fl y
|
1996-11-17 03:51:33 +00:00
|
|
|
.Op Ar username
|
|
|
|
.Sh DESCRIPTION
|
1997-03-08 18:04:45 +00:00
|
|
|
The utility
|
1996-11-17 03:51:33 +00:00
|
|
|
.Nm rmuser
|
1997-03-08 18:04:45 +00:00
|
|
|
.Pp
|
|
|
|
.Bl -enum
|
|
|
|
.It
|
|
|
|
Removes the user's
|
1996-11-17 03:51:33 +00:00
|
|
|
.Xr crontab 1
|
1997-03-08 18:04:45 +00:00
|
|
|
entry (if any)
|
|
|
|
.It
|
|
|
|
Removes any
|
1996-11-17 03:51:33 +00:00
|
|
|
.Xr at 1
|
1997-03-08 18:04:45 +00:00
|
|
|
jobs belonging to the user
|
|
|
|
.It
|
|
|
|
Sends a SIGKILL signal to all processes owned by the user
|
|
|
|
.It
|
|
|
|
Removes the user from the system's local password file
|
|
|
|
.It
|
|
|
|
Removes the user's home directory (if it is owned by the user),
|
|
|
|
including handling of symbolic links in the path to the actual home
|
|
|
|
directory
|
|
|
|
.It
|
|
|
|
Removes the incoming mail and pop daemon mail files belonging to the
|
|
|
|
user from
|
|
|
|
.Pa /var/mail
|
|
|
|
.It
|
|
|
|
Removes all files owned by the user from
|
|
|
|
.Pa /tmp ,
|
|
|
|
.Pa /var/tmp ,
|
|
|
|
and
|
|
|
|
.Pa /var/tmp/vi.recover .
|
|
|
|
.It
|
|
|
|
Removes the username from all groups to which it belongs in
|
1996-11-17 03:51:33 +00:00
|
|
|
.Pa /etc/group .
|
1997-03-08 18:04:45 +00:00
|
|
|
(If a group becomes empty and the group name is the same as the username,
|
|
|
|
the group is removed; this complements
|
1996-11-17 03:51:33 +00:00
|
|
|
.Xr adduser 8 's
|
|
|
|
per-user unique groups).
|
1997-03-08 18:04:45 +00:00
|
|
|
.El
|
1996-11-17 03:51:33 +00:00
|
|
|
.Pp
|
|
|
|
.Nm rmuser
|
|
|
|
politely refuses to remove users whose uid is 0 (typically root), since
|
1997-03-08 18:04:45 +00:00
|
|
|
certain actions (namely, killing all the user's processes, and perhaps
|
|
|
|
removing the user's home directory) would cause damage to a running system.
|
|
|
|
If it is necessary to remove a user whose uid is 0, see
|
|
|
|
.Xr vipw 8
|
|
|
|
for information on directly editing the password file, by which the desired
|
|
|
|
user's
|
|
|
|
.Xr passwd 5
|
|
|
|
entry may be removed manually.
|
1996-11-17 03:51:33 +00:00
|
|
|
.Pp
|
1997-03-08 18:04:45 +00:00
|
|
|
If not running "affirmitively" (i.e., option
|
|
|
|
.Fl y
|
|
|
|
is not specified),
|
1996-11-17 03:51:33 +00:00
|
|
|
.Nm rmuser
|
|
|
|
shows the selected user's password file entry and asks for confirmation
|
|
|
|
that you wish to remove the user. If the user's home directory is owned
|
1997-03-08 18:04:45 +00:00
|
|
|
by the user,
|
1996-11-17 03:51:33 +00:00
|
|
|
.Nm rmuser
|
|
|
|
asks whether you wish to remove the user's home directory and everything
|
|
|
|
below.
|
|
|
|
.Pp
|
1997-03-08 18:04:45 +00:00
|
|
|
As
|
|
|
|
.Nm rmuser
|
|
|
|
operates, it informs the user regarding the current activity. If any
|
|
|
|
errors occur, they are posted to standard error and, if it is possible for
|
|
|
|
.Nm rmuser
|
|
|
|
to continue, it will.
|
|
|
|
.Pp
|
1996-11-17 03:51:33 +00:00
|
|
|
Available options:
|
|
|
|
.Pp
|
|
|
|
.Bl -tag -width username
|
1997-03-08 18:04:45 +00:00
|
|
|
.It Fl y
|
|
|
|
Affirm - any question that would be asked is answered implicitly in
|
|
|
|
the affirmative (i.e., yes). A username must also be specified on the
|
|
|
|
command line if this option is used.
|
1996-11-17 03:51:33 +00:00
|
|
|
.It Ar \&username
|
|
|
|
Identifies the user to be removed; if not present,
|
|
|
|
.Nm rmuser
|
|
|
|
interactively asks for the user to be removed.
|
|
|
|
.Sh FILES
|
|
|
|
.Bl -tag -width /etc/master.passwd -compact
|
|
|
|
.It Pa /etc/master.passwd
|
|
|
|
.It Pa /etc/passwd
|
|
|
|
.It Pa /etc/group
|
|
|
|
.It Pa /etc/spwd.db
|
|
|
|
.It Pa /etc/pwd.db
|
|
|
|
.El
|
|
|
|
.Sh SEE ALSO
|
|
|
|
.Xr at 1 ,
|
|
|
|
.Xr chpass 1 ,
|
|
|
|
.Xr crontab 1 ,
|
|
|
|
.Xr finger 1 ,
|
|
|
|
.Xr passwd 1 ,
|
|
|
|
.Xr group 5 ,
|
|
|
|
.Xr passwd 5 ,
|
|
|
|
.Xr addgroup 8 ,
|
1997-01-20 00:03:00 +00:00
|
|
|
.Xr adduser 8 ,
|
1996-11-17 03:51:33 +00:00
|
|
|
.Xr pwd_mkdb 8 ,
|
|
|
|
.Xr rmgroup 8 ,
|
|
|
|
.Xr vipw 8
|
|
|
|
.Sh HISTORY
|
|
|
|
The
|
|
|
|
.Nm
|
1997-03-08 18:04:45 +00:00
|
|
|
command appeared in
|
|
|
|
.Fx 2.2 .
|
1996-11-17 03:51:33 +00:00
|
|
|
.\" .Sh AUTHOR
|
1997-03-08 18:04:45 +00:00
|
|
|
.\" Guy Helmer, Ames, Iowa
|
|
|
|
.Sh BUGS
|
|
|
|
.Nm rmuser
|
|
|
|
does not comprehensively search the filesystem for all files
|
|
|
|
owned by the removed user and remove them; to do so on a system
|
|
|
|
of any size is prohibitively slow and I/O intensive.
|
|
|
|
.Nm rmuser
|
|
|
|
also is unable to remove symbolic links that were created by the
|
|
|
|
user in
|
|
|
|
.Pa /tmp
|
|
|
|
or
|
|
|
|
.Pa /var/tmp
|
|
|
|
as symbolic links on 4.4BSD filesystems do not contain information
|
|
|
|
as to who created them. Also, there may be other files created in
|
|
|
|
.Pa /var/mail
|
|
|
|
other than
|
|
|
|
.Pa /var/mail/username
|
|
|
|
and
|
|
|
|
.Pa /var/mail/.pop.username
|
|
|
|
that are not owned by the removed user but should be removed.
|
|
|
|
.Pp
|
|
|
|
.Nm rmuser
|
|
|
|
has no knowledge of NIS (Yellow Pages), and it operates only on the
|
|
|
|
local password file.
|