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.
|
|
|
|
.\"
|
1999-08-28 01:35:59 +00:00
|
|
|
.\" $FreeBSD$
|
1996-11-17 03:51:33 +00:00
|
|
|
.\"
|
2002-12-03 05:41:09 +00:00
|
|
|
.Dd May 10, 2002
|
1996-11-17 03:51:33 +00:00
|
|
|
.Dt RMUSER 8
|
|
|
|
.Os
|
|
|
|
.Sh NAME
|
|
|
|
.Nm rmuser
|
2002-12-04 14:44:20 +00:00
|
|
|
.Nd remove users from the system
|
1996-11-17 03:51:33 +00:00
|
|
|
.Sh SYNOPSIS
|
2000-11-20 20:10:44 +00:00
|
|
|
.Nm
|
1997-03-08 18:04:45 +00:00
|
|
|
.Op Fl y
|
2002-12-03 05:41:09 +00:00
|
|
|
.Op Fl f Ar file
|
|
|
|
.Op Ar username ...
|
1996-11-17 03:51:33 +00:00
|
|
|
.Sh DESCRIPTION
|
2002-07-14 14:47:15 +00:00
|
|
|
The
|
1997-09-01 06:14:17 +00:00
|
|
|
.Nm
|
2002-12-03 05:41:09 +00:00
|
|
|
utility removes one or more users submitted on the command line
|
2002-12-04 14:44:20 +00:00
|
|
|
or from a file.
|
|
|
|
In removing a user from the system, this utility:
|
1997-03-08 18:04:45 +00:00
|
|
|
.Bl -enum
|
|
|
|
.It
|
2001-07-15 08:06:20 +00:00
|
|
|
Removes the user's
|
1996-11-17 03:51:33 +00:00
|
|
|
.Xr crontab 1
|
1997-09-01 06:14:17 +00:00
|
|
|
entry (if any).
|
1997-03-08 18:04:45 +00:00
|
|
|
.It
|
2001-07-15 08:06:20 +00:00
|
|
|
Removes any
|
1996-11-17 03:51:33 +00:00
|
|
|
.Xr at 1
|
1997-09-01 06:14:17 +00:00
|
|
|
jobs belonging to the user.
|
1997-03-08 18:04:45 +00:00
|
|
|
.It
|
2002-12-04 14:44:20 +00:00
|
|
|
Sends a
|
|
|
|
.Dv SIGKILL
|
|
|
|
signal to all processes owned by the user.
|
1997-03-08 18:04:45 +00:00
|
|
|
.It
|
1997-09-01 06:14:17 +00:00
|
|
|
Removes the user from the system's local password file.
|
1997-03-08 18:04:45 +00:00
|
|
|
.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
|
1997-09-01 06:14:17 +00:00
|
|
|
directory.
|
1997-03-08 18:04:45 +00:00
|
|
|
.It
|
2002-12-04 14:44:20 +00:00
|
|
|
Removes the incoming mail and POP daemon mail files belonging to the
|
2001-07-15 08:06:20 +00:00
|
|
|
user from
|
1997-09-01 06:14:17 +00:00
|
|
|
.Pa /var/mail .
|
1997-03-08 18:04:45 +00:00
|
|
|
.It
|
|
|
|
Removes all files owned by the user from
|
2002-12-04 14:44:20 +00:00
|
|
|
.Pa /tmp , /var/tmp ,
|
1997-03-08 18:04:45 +00:00
|
|
|
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
|
2001-01-16 09:39:23 +00:00
|
|
|
.Xr adduser 8 Ns 's
|
2002-12-04 14:44:20 +00:00
|
|
|
per-user unique groups.)
|
1997-03-08 18:04:45 +00:00
|
|
|
.El
|
1996-11-17 03:51:33 +00:00
|
|
|
.Pp
|
2002-12-04 14:44:20 +00:00
|
|
|
The
|
2002-07-14 14:47:15 +00:00
|
|
|
.Nm
|
2002-12-04 14:44:20 +00:00
|
|
|
utility 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.
|
2002-12-04 14:44:20 +00:00
|
|
|
If it is necessary to remove a user whose UID is 0, see
|
1997-03-08 18:04:45 +00:00
|
|
|
.Xr vipw 8
|
2002-12-04 14:44:20 +00:00
|
|
|
for information on directly editing the password file.
|
1996-11-17 03:51:33 +00:00
|
|
|
.Pp
|
2002-12-03 05:41:09 +00:00
|
|
|
If
|
1997-09-01 06:14:17 +00:00
|
|
|
.Nm
|
2002-12-03 05:41:09 +00:00
|
|
|
was not invoked with the
|
|
|
|
.Fl y
|
2002-12-04 14:44:20 +00:00
|
|
|
option, it will
|
2002-12-03 05:41:09 +00:00
|
|
|
show the selected user's password file entry and ask for confirmation
|
2002-12-04 14:44:20 +00:00
|
|
|
that the user be removed.
|
|
|
|
It will then ask for confirmation to delete
|
|
|
|
the user's home directory.
|
|
|
|
If the answer is in the affirmative, the home
|
2002-12-03 05:41:09 +00:00
|
|
|
directory and any files and subdirectories under it will be deleted only if
|
2002-12-04 14:44:20 +00:00
|
|
|
they are owned by the user.
|
|
|
|
See
|
2002-12-03 05:41:09 +00:00
|
|
|
.Xr pw 8
|
|
|
|
for more details.
|
1996-11-17 03:51:33 +00:00
|
|
|
.Pp
|
1997-03-08 18:04:45 +00:00
|
|
|
As
|
1997-09-01 06:14:17 +00:00
|
|
|
.Nm
|
2002-12-04 14:44:20 +00:00
|
|
|
operates, it informs the user regarding the current activity.
|
|
|
|
If any
|
1997-03-08 18:04:45 +00:00
|
|
|
errors occur, they are posted to standard error and, if it is possible for
|
1997-09-01 06:14:17 +00:00
|
|
|
.Nm
|
1997-03-08 18:04:45 +00:00
|
|
|
to continue, it will.
|
|
|
|
.Pp
|
2002-12-04 14:44:20 +00:00
|
|
|
The options are as follows:
|
|
|
|
.Bl -tag -width ".Ar username"
|
|
|
|
.It Fl f Ar file
|
2002-12-03 05:41:09 +00:00
|
|
|
The
|
|
|
|
.Nm
|
|
|
|
utility will get a list of users to be removed from
|
|
|
|
.Ar file ,
|
2002-12-04 14:44:20 +00:00
|
|
|
which will contain one user per line.
|
|
|
|
Anything following a hash mark
|
|
|
|
.Pq Ql # ,
|
2002-12-03 05:41:09 +00:00
|
|
|
including the hash mark itself, is considered a comment and will not
|
2002-12-04 14:44:20 +00:00
|
|
|
be processed.
|
|
|
|
If the file is owned by anyone other than a user with
|
|
|
|
UID 0, or is writeable by anyone other than the owner,
|
2002-12-03 05:41:09 +00:00
|
|
|
.Nm
|
|
|
|
will refuse to continue.
|
2002-12-04 14:44:20 +00:00
|
|
|
.It Fl y
|
|
|
|
Implicitly answer
|
|
|
|
.Dq Li yes
|
|
|
|
to any and all prompts.
|
|
|
|
Currently, this includes
|
|
|
|
prompts on whether to remove the specified user and whether to remove
|
|
|
|
the home directory.
|
|
|
|
This option requires that either the
|
|
|
|
.Fl f
|
2002-12-27 12:15:40 +00:00
|
|
|
option be used, or one or more user names be given as command line
|
2002-12-04 14:44:20 +00:00
|
|
|
arguments.
|
|
|
|
.It Ar username
|
2002-12-03 05:41:09 +00:00
|
|
|
Identifies one or more users to be removed; if not present,
|
1997-09-01 06:14:17 +00:00
|
|
|
.Nm
|
2002-12-03 05:41:09 +00:00
|
|
|
interactively asks for one or more users to be removed.
|
2000-12-27 15:30:30 +00:00
|
|
|
.El
|
1996-11-17 03:51:33 +00:00
|
|
|
.Sh FILES
|
2002-12-04 14:44:20 +00:00
|
|
|
.Bl -tag -compact
|
1996-11-17 03:51:33 +00:00
|
|
|
.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 ,
|
1997-01-20 00:03:00 +00:00
|
|
|
.Xr adduser 8 ,
|
2002-12-03 05:41:09 +00:00
|
|
|
.Xr pw 8 ,
|
1996-11-17 03:51:33 +00:00
|
|
|
.Xr pwd_mkdb 8 ,
|
|
|
|
.Xr vipw 8
|
|
|
|
.Sh HISTORY
|
|
|
|
The
|
|
|
|
.Nm
|
2002-12-04 14:44:20 +00:00
|
|
|
utility appeared in
|
1997-03-08 18:04:45 +00:00
|
|
|
.Fx 2.2 .
|
|
|
|
.Sh BUGS
|
2002-07-14 14:47:15 +00:00
|
|
|
The
|
|
|
|
.Nm
|
2002-12-12 17:26:04 +00:00
|
|
|
utility does not comprehensively search the file system for all files
|
1997-03-08 18:04:45 +00:00
|
|
|
owned by the removed user and remove them; to do so on a system
|
|
|
|
of any size is prohibitively slow and I/O intensive.
|
2002-12-03 05:41:09 +00:00
|
|
|
It is also unable to remove symbolic links that were created by the
|
1997-03-08 18:04:45 +00:00
|
|
|
user in
|
|
|
|
.Pa /tmp
|
|
|
|
or
|
2002-12-04 14:44:20 +00:00
|
|
|
.Pa /var/tmp ,
|
2001-08-14 10:01:54 +00:00
|
|
|
as symbolic links on
|
|
|
|
.Bx 4.4
|
2002-12-12 17:26:04 +00:00
|
|
|
file systems do not contain information
|
2002-12-04 14:44:20 +00:00
|
|
|
as to who created them.
|
|
|
|
Also, there may be other files created in
|
1997-03-08 18:04:45 +00:00
|
|
|
.Pa /var/mail
|
|
|
|
other than
|
2002-12-04 14:44:20 +00:00
|
|
|
.Pa /var/mail/ Ns Ar username
|
1997-03-08 18:04:45 +00:00
|
|
|
and
|
2002-12-04 14:44:20 +00:00
|
|
|
.Pa /var/mail/.pop. Ns Ar username
|
1997-03-08 18:04:45 +00:00
|
|
|
that are not owned by the removed user but should be removed.
|
|
|
|
.Pp
|
2002-07-14 14:47:15 +00:00
|
|
|
The
|
|
|
|
.Nm
|
2002-12-04 14:44:20 +00:00
|
|
|
utility has no knowledge of YP/NIS, and it operates only on the
|
1997-03-08 18:04:45 +00:00
|
|
|
local password file.
|