'\" t .\" Title: userdel .\" Author: Julianne Frances Haugh .\" Generator: DocBook XSL Stylesheets vsnapshot .\" Date: 30.07.2026 .\" Manual: System Management Commands .\" Source: shadow-utils 4.20.0 .\" Language: German .\" .TH "USERDEL" "8" "30.07.2026" "shadow\-utils 4\&.20\&.0" "System Management Commands" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" userdel \- l\(:oscht ein Benutzerkonto und die dazugeh\(:origen Dateien .SH "\(:UBERSICHT" .HP \w'\fBuserdel\fR\ 'u \fBuserdel\fR [options] \fILOGIN\fR .SH "BESCHREIBUNG" .PP The \fBuserdel\fR command modifies the system account files, deleting all entries that refer to the user name \fILOGIN\fR\&. The named user must exist\&. .SH "OPTIONEN" .PP The options which apply to the \fBuserdel\fR command are: .PP \fB\-f\fR, \fB\-\-force\fR .RS 4 This option forces the removal of the user account and any other requested actions, skipping any safety checks\&. .sp \fINote:\fR This option is dangerous and may leave your system in an inconsistent state\&. .RE .PP \fB\-h\fR, \fB\-\-help\fR .RS 4 zeigt die Hilfe an und beendet das Programm\&. .RE .PP \fB\-r\fR, \fB\-\-remove\fR .RS 4 entfernt das pers\(:onliche Verzeichnis des Benutzers mit den darin enthaltenen Dateiein und die Mail\-Warteschlange\&. Dateien in anderen Dateisystemen m\(:ussen per Hand gesucht und gel\(:oscht werden\&. .sp The mail spool is defined by the \fBMAIL_DIR\fR variable in the login\&.defs file\&. .RE .PP \fB\-R\fR, \fB\-\-root\fR\ \&\fICHROOT_DIR\fR .RS 4 Apply changes in the \fICHROOT_DIR\fR directory and use the configuration files from the \fICHROOT_DIR\fR directory\&. Only absolute paths are supported\&. No SELINUX support\&. .RE .PP \fB\-P\fR, \fB\-\-prefix\fR\ \&\fIPREFIX_DIR\fR .RS 4 Apply changes in the \fIPREFIX_DIR\fR directory and use the configuration files from the \fIPREFIX_DIR\fR directory\&. This option does not chroot and is intended for preparing a cross\-compilation target\&. Some limitations: NIS and LDAP users/groups are not verified\&. PAM authentication is using the host files\&. No SELINUX support\&. .RE .PP \fB\-Z\fR, \fB\-\-selinux\-user\fR .RS 4 entfernt jegliche Zuordnung zu SELinux\-Benutzern f\(:ur das Benutzerkonto\&. .RE .SH "KONFIGURATION" .PP The following configuration variables in /etc/login\&.defs change the behavior of this tool: .PP \fBMAIL_DIR\fR (string) .RS 4 The mail spool directory\&. This is needed to manipulate the mailbox when its corresponding user account is modified or deleted\&. If not specified, a compile\-time default is used\&. The parameter CREATE_MAIL_SPOOL in /etc/default/useradd determines whether the mail spool should be created\&. .RE .PP \fBMAIL_FILE\fR (string) .RS 4 legt fest, wo sich die Dateien der Mail\-Warteschlange des Benutzers relativ zu seinem pers\(:onlichen Verzeichnis befinden\&. .RE .PP The \fBMAIL_DIR\fR and \fBMAIL_FILE\fR variables are used by \fBuseradd\fR, \fBusermod\fR, and \fBuserdel\fR to create, move, or delete the user\*(Aqs mail spool\&. .PP \fBMAX_MEMBERS_PER_GROUP\fR (number) .RS 4 Maximum members per group entry\&. When the maximum is reached, a new group entry (line) is started in /etc/group (with the same name, same password, and same GID)\&. .sp Der Standardwert ist 0, was bedeutet, dass die Anzahl der Mitglieder einer Gruppe nicht begrenzt ist\&. .sp Das Aufteilen von Gruppen erm\(:oglicht es, L\(:angenvorgaben f\(:ur die Zeilen der Gruppendatei einzuhalten\&. Damit kann sichergestellt werden, dass die Zeilen f\(:ur NIS\-Gruppen nicht l\(:anger als 1024 Zeichen sind\&. .sp Falls Sie eine solche Begrenzung ben\(:otigen, k\(:onnen Sie 25 verwenden\&. .sp Hinweis: Mit aufgeteilten Gruppen k\(:onnen m\(:oglicherweise nicht alle Hilfsprogramme (nicht einmal jene der Shadow\-Programmsammlung) umgehen\&. Sie sollten diese Variable nur setzen, wenn Sie sie wirklich ben\(:otigen\&. .RE .PP \fBUSERDEL_CMD\fR (string) .RS 4 falls angegeben, wird dieser Befehl ausgef\(:uhrt, wenn ein Benutzer entfernt wird\&. Damit k\(:onnen At\-, Cron\- und Druckauftr\(:age etc\&. des Benutzers (sein Name ist als erstes Argument zu \(:ubergeben) gel\(:oscht werden\&. .sp Der R\(:uckgabewert des Skripts bleibt unber\(:ucksichtigt\&. .sp Here is an example script, which removes the user\*(Aqs cron, at and print jobs: .sp .if n \{\ .RS 4 .\} .nf #! /bin/sh # Check for the required argument\&. if [ $# != 1 ]; then echo "Usage: $0 username" exit 1 fi # Remove cron jobs\&. crontab \-r \-u $1 # Remove at jobs\&. # Note that it will remove any jobs owned by the same UID, # even if it was shared by a different username\&. AT_SPOOL_DIR=/var/spool/cron/atjobs find $AT_SPOOL_DIR \-name "[^\&.]*" \-type f \-user $1 \-delete \e; # Remove print jobs\&. lprm $1 # All done\&. exit 0 .fi .if n \{\ .RE .\} .sp .RE .PP \fBUSERGROUPS_ENAB\fR (boolean) .RS 4 If set to \fIyes\fR, \fBuserdel\fR will remove the user\*(Aqs group if it contains no more members, and \fBuseradd\fR will create by default a group with the name of the user\&. .RE .SH "DATEIEN" .PP /etc/group .RS 4 Informationen zu den Gruppenkonten .RE .PP /etc/login\&.defs .RS 4 konfiguriert die Shadow\-Hilfsprogramme\&. .RE .PP /etc/passwd .RS 4 Informationen zu den Benutzerkonten .RE .PP /etc/shadow .RS 4 gesch\(:utzte Informationen zu den Benutzerkonten .RE .PP /etc/shadow\-maint/userdel\-pre\&.d/*, /etc/shadow\-maint/userdel\-post\&.d/* .RS 4 Run\-part files to execute during user deletion\&. The environment variable \fBACTION\fR will be populated with \fBuserdel\fR and \fBSUBJECT\fR with the username\&. userdel\-pre\&.d will be executed prior to any user deletion\&. userdel\-post\&.d will execute after user deletion\&. If a script exits non\-zero then execution will terminate\&. .RE .PP /etc/subgid .RS 4 enth\(:alt untergeordnete Gruppenkennungen der einzelnen Benutzer\&. .RE .PP /etc/subuid .RS 4 enth\(:alt untergeordnete Benutzerkennungen der einzelnen Benutzer\&. .RE .SH "R\(:UCKGABEWERTE" .PP The \fBuserdel\fR command exits with the following values: .PP \fI0\fR .RS 4 success .RE .PP \fI1\fR .RS 4 can\*(Aqt update password file .RE .PP \fI2\fR .RS 4 invalid command syntax .RE .PP \fI6\fR .RS 4 specified user doesn\*(Aqt exist .RE .PP \fI8\fR .RS 4 user currently logged in .RE .PP \fI10\fR .RS 4 can\*(Aqt update group file .RE .PP \fI12\fR .RS 4 can\*(Aqt remove home directory .RE .SH "WARNUNGEN" .PP \fBuserdel\fR will not allow you to remove an account if there are running processes which belong to this account\&. In that case, you may have to kill those processes or lock the user\*(Aqs password or account and remove the account later\&. The \fB\-f\fR option can force the deletion of this account\&. .PP Sie sollten von Hand alle Dateisysteme in Hinblick auf Dateien dieses Benutzers pr\(:ufen und sie gegebenenfalls l\(:oschen\&. .PP Sie d\(:urfen keine NIS\-Attribute auf einem NIS\-Client l\(:oschen\&. Dies muss auf dem NIS\-Server durchgef\(:uhrt werden\&. .PP If \fBUSERGROUPS_ENAB\fR is defined to \fIyes\fR in /etc/login\&.defs, \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 group otherwise\&. The \fB\-f\fR option can force the deletion of this group\&. .SH "SIEHE AUCH" .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), \fBsubgid\fR(5), \fBsubuid\fR(5), \fBuseradd\fR(8), \fBusermod\fR(8)\&.