shadow/man/userdel.8

119 lines
3.1 KiB
Groff

.\" ** You probably do not want to edit this file directly **
.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1).
.\" Instead of manually editing it, you probably should edit the DocBook XML
.\" source for it and then use the DocBook XSL Stylesheets to regenerate it.
.TH "USERDEL" "8" "11/05/2005" "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 [\-f] [\-r] \fIlogin_name\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
\fB\-f\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 let your system in an inconsistent state.
.TP
\fB\-r\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
\fI/etc/group\fR
group account information
.TP
\fI/etc/login.defs\fR
shadow password suite configuration
.TP
\fI/etc/passwd\fR
user account information
.TP
\fI/etc/shadow\fR
secure user account information
.SH "EXIT VALUES"
.PP
The
\fBuserdel\fR
command exits with the following values:
.TP
\fI0\fR
success
.TP
\fI1\fR
can't update password file
.TP
\fI2\fR
invalid command syntax
.TP
\fI6\fR
specified user doesn't exist
.TP
\fI8\fR
user currently logged in
.TP
\fI10\fR
can't update group file
.TP
\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).