--- src/usr.sbin/adduser/rmuser.8 2003/06/17 04:29:52 1.2 +++ src/usr.sbin/adduser/rmuser.8 2004/06/21 17:47:12 1.3 @@ -24,23 +24,26 @@ .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.\" $FreeBSD: src/usr.sbin/adduser/rmuser.8,v 1.10.2.6 2003/03/13 03:10:59 trhodes Exp $ -.\" $DragonFly: src/usr.sbin/adduser/rmuser.8,v 1.1 2003/06/16 07:16:38 dillon Exp $ +.\" $FreeBSD: src/usr.sbin/adduser/rmuser.8,v 1.23 2004/06/08 14:52:55 csjp Exp $ +.\" $DragonFly$ .\" -.Dd February 23, 1997 +.Dd May 10, 2002 .Dt RMUSER 8 .Os .Sh NAME .Nm rmuser -.Nd removes users from the system +.Nd remove users from the system .Sh SYNOPSIS .Nm -.Op Fl y -.Op Ar username +.Op Fl yv +.Op Fl f Ar file +.Op Ar username ... .Sh DESCRIPTION -The utility +The .Nm -.Pp +utility removes one or more users submitted on the command line +or from a file. +In removing a user from the system, this utility: .Bl -enum .It Removes the user's @@ -75,52 +78,87 @@ Removes the username from all groups to (If a group becomes empty and the group name is the same as the username, the group is removed; this complements .Xr adduser 8 Ns 's -per-user unique groups). +per-user unique groups.) +.It +Removes all message queues, shared memory segments and +semaphores owned by the user. .El .Pp -.Nm Rmuser -politely refuses to remove users whose uid is 0 (typically root), since +The +.Nm +utility refuses to remove users whose UID is 0 (typically root), since 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 +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. +for information on directly editing the password file. .Pp -If not running "affirmatively" (i.e., option -.Fl y -is not specified), +If .Nm -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 -by the user, -.Nm -asks whether you wish to remove the user's home directory and everything -below. +was not invoked with the +.Fl y +option, it will +show the selected user's password file entry and ask for confirmation +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 +directory and any files and subdirectories under it will be deleted only if +they are owned by the user. +See +.Xr pw 8 +for more details. .Pp As .Nm -operates, it informs the user regarding the current activity. If any +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 to continue, it will. .Pp -Available options: -.Pp -.Bl -tag -width username +The options are as follows: +.Bl -tag -width ".Ar username" +.It Fl f Ar file +The +.Nm +utility will get a list of users to be removed from +.Ar file , +which will contain one user per line. +Anything following a hash mark +.Pq Ql # , +including the hash mark itself, is considered a comment and will not +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, +.Nm +will refuse to continue. .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. -.It Ar \&username -Identifies the user to be removed; if not present, +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 +option be used, or one or more user names be given as command line +arguments. +.It Fl v +Enable verbose mode. +Normally, +the output inlcudes one line per removed user; +however, +with this option +.Nm +will be much more chatty about the steps taken. +.It Ar username +Identifies one or more users to be removed; if not present, .Nm -interactively asks for the user to be removed. +interactively asks for one or more users to be removed. .El .Sh FILES -.Bl -tag -width /etc/master.passwd -compact +.Bl -tag -compact .It Pa /etc/master.passwd .It Pa /etc/passwd .It Pa /etc/group