shadow/man/userdel.8

127 lines
3.2 KiB
Groff

.\" Title: userdel
.\" Author:
.\" Generator: DocBook XSL Stylesheets v1.70.1 <http://docbook.sf.net/>
.\" Date: 06/06/2006
.\" Manual: System Management Commands
.\" Source: System Management Commands
.\"
.TH "USERDEL" "8" "06/06/2006" "System Management Commands" "System Management Commands"
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.SH "NAME"
userdel \- delete a user account and related files
.SH "SYNOPSIS"
.HP 8
\fBuserdel\fR [options] \fILOGIN\fR
.SH "DESCRIPTION"
.PP
The
\fBuserdel\fR
command modifies the system account files, deleting all entries that refer to
\fIlogin_name\fR. The named user must exist.
.SH "OPTIONS"
.PP
The options which apply to the
\fBuserdel\fR
command are:
.TP 3n
\fB\-f\fR, \fB\-\-force\fR
This option forces the removal of the user, even if she is still logged in. It also forces
\fBuserdel\fR
to remove the user's home directory or her mail spool, even if another user uses the same home directory or if the mail spool is not owned by the specified user. If
\fIUSERGROUPS_ENAB\fR
is defined to
\fIyes\fR
in
\fI/etc/login.defs\fR
and if a group exists with the same name as the deleted user, then this group will be removed, even if it is still the primary group of another user.
.sp
\fINote:\fR
This option is dangerous and may leave your system in an inconsistent state.
.TP 3n
\fB\-h\fR, \fB\-\-help\fR
Display help message and exit.
.TP 3n
\fB\-r\fR, \fB\-\-remove\fR
Files in the user's home directory will be removed along with the home directory itself and the user's mail spool. Files located in other file systems will have to be searched for and deleted manually.
.sp
The mail spool is defined by the
\fIMAIL_DIR\fR
variable in the
\fIlogin.defs\fR
file.
.SH "FILES"
.TP 3n
\fI/etc/group\fR
Group account information.
.TP 3n
\fI/etc/login.defs\fR
Shadow password suite configuration.
.TP 3n
\fI/etc/passwd\fR
User account information.
.TP 3n
\fI/etc/shadow\fR
Secure user account information.
.SH "EXIT VALUES"
.PP
The
\fBuserdel\fR
command exits with the following values:
.TP 3n
\fI0\fR
success
.TP 3n
\fI1\fR
can't update password file
.TP 3n
\fI2\fR
invalid command syntax
.TP 3n
\fI6\fR
specified user doesn't exist
.TP 3n
\fI8\fR
user currently logged in
.TP 3n
\fI10\fR
can't update group file
.TP 3n
\fI12\fR
can't remove home directory
.SH "CAVEATS"
.PP
\fBuserdel\fR
will not allow you to remove an account if the user is currently logged in. You must kill any running processes which belong to an account that you are deleting.
.PP
You may not remove any NIS attributes on a NIS client. This must be performed on the NIS server.
.PP
If
\fIUSERGROUPS_ENAB\fR
is defined to
\fIyes\fR
in
\fI/etc/login.defs\fR,
\fBuserdel\fR
will delete the group with the same name as the user. To avoid inconsistencies in the passwd and group databases,
\fBuserdel\fR
will check that this group is not used as a primary group for another user, and will just warn without deleting the user otherwise. The
\fB\-f\fR
option can force the deletion of this group.
.SH "SEE ALSO"
.PP
\fBchfn\fR(1),
\fBchsh\fR(1),
\fBpasswd\fR(1),
\fBlogin.defs\fR(5),
\fBgpasswd\fR(8),
\fBgroupadd\fR(8),
\fBgroupdel\fR(8),
\fBgroupmod\fR(8),
\fBuseradd\fR(8),
\fBusermod\fR(8).