man-pages/man8/deluser.8.html
2021-03-31 01:06:50 +01:00

331 lines
7.8 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML><HEAD><TITLE>Man page of DELUSER</TITLE>
</HEAD><BODY>
<H1>DELUSER</H1>
Section: Maintenance Commands (8)<BR>Updated: Version 3.118ubuntu2<BR><A HREF="#index">Index</A>
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
<A NAME="lbAB">&nbsp;</A>
<H2>NAME</H2>
deluser, delgroup - remove a user or group from the system
<A NAME="lbAC">&nbsp;</A>
<H2>SYNOPSIS</H2>
<B>deluser</B> [options] [--force] [--remove-home] [--remove-all-files] [--backup] [--backup-to DIR] user
<P>
<B>deluser</B> --group [options] group
<BR>
<B>delgroup</B> [options] [--only-if-empty] group
<P>
<B>deluser</B> [options] user group
<A NAME="lbAD">&nbsp;</A>
<H3>COMMON OPTIONS</H3>
<BR>
[--quiet] [--system] [--help] [--version] [--conf FILE]
<A NAME="lbAE">&nbsp;</A>
<H2>DESCRIPTION</H2>
<P>
<B>deluser</B> and <B>delgroup</B>
remove users and groups from the system according to command line options
and configuration information in
<I>/etc/deluser.conf</I>
and
<I>/etc/adduser.conf</I>.
They are friendlier front ends to the
<B>userdel</B> and <B>groupdel</B>
programs, removing the home directory as option or even all files on the system
owned by the user to be removed, running a custom script, and other features.
<B>deluser</B> and <B>delgroup</B>
can be run in one of three modes:
<A NAME="lbAF">&nbsp;</A>
<H3>Remove a normal user</H3>
If called with one non-option argument and without the
<B>--group</B> option, <B>deluser</B>
will remove a normal user.
<P>
By default,
<B>deluser</B>
will remove the user without removing the home directory, the mail spool or
any other files on the system owned by the user. Removing the home directory
and mail spool can be achieved using the
<B>--remove-home</B>
option.
<P>
The
<B>--remove-all-files</B>
option removes all files on the system owned by the user. Note that if
you activate both options
<B>--remove-home</B>
will have no effect because all files including the home directory and mail
spool are already covered by the
<B>--remove-all-files</B>
option.
<P>
If you want to backup all files before deleting them you can activate the
<B>--backup</B>
option which will create a file username.tar(.gz|.bz2) in the
directory specified by the
<B>--backup-to</B>
option (defaulting to the current working directory). Both the remove
and backup options can also be activated for default in the configuration
file /etc/deluser.conf. See
<B><A HREF="/cgi-bin/man/man2html?5+deluser.conf">deluser.conf</A>(5)</B>
for details.
<P>
If you want to remove the root account (uid 0), then use the
<B>--force </B>
parameter; this may prevent to remove the root user by accident.
<P>
If the file
<B>/usr/local/sbin/deluser.local</B>
exists, it will be executed after the user account has been removed
in order to do any local cleanup. The arguments passed to
<B>deluser.local</B>
are:
<BR>
username uid gid home-directory
<P>
<A NAME="lbAG">&nbsp;</A>
<H3>Remove a group</H3>
If
<B>deluser</B> is called with the <B>--group</B> option, or <B>delgroup</B>
is called, a group will be removed.
<P>
Warning: The primary group of an existing user cannot be removed.
<P>
If the option
<B>--only-if-empty</B>
is given, the group won't be removed if it has any members left.
<P>
<A NAME="lbAH">&nbsp;</A>
<H3>Remove a user from a specific group</H3>
If called with two non-option arguments,
<B>deluser</B>
will remove a user from a specific group.
<A NAME="lbAI">&nbsp;</A>
<H2>OPTIONS</H2>
<DL COMPACT>
<DT id="1"><B>--conf FILE</B>
<DD>
Use FILE instead of the default files
<I>/etc/deluser.conf</I>
and
<I>/etc/adduser.conf</I>
<DT id="2"><B>--group</B>
<DD>
Remove a group. This is the default action if the program is invoked
as
<I>delgroup</I>.
<DT id="3"><B>--help</B>
<DD>
Display brief instructions.
<DT id="4"><B>--quiet</B>
<DD>
Suppress progress messages.
<DT id="5"><B>--system</B>
<DD>
Only delete if user/group is a system user/group. This avoids
accidentally deleting non-system users/groups. Additionally, if the
user does not exist, no error value is returned. This option is mainly
for use in Debian package maintainer scripts.
<DT id="6"><B>--only-if-empty </B>
<DD>
Only remove if no members are left.
<DT id="7"><B>--backup</B>
<DD>
Backup all files contained in the userhome and the mailspool-file to a file named
/$user.tar.bz2 or /$user.tar.gz.
<DT id="8"><B>--backup-to</B>
<DD>
Place the backup files not in / but in the directory specified by this parameter. This implicitly sets --backup also.
<DT id="9"><B>--remove-home</B>
<DD>
Remove the home directory of the user and its mailspool. If --backup is specified,
the files are deleted after having performed the backup.
<DT id="10"><B>--remove-all-files</B>
<DD>
Remove all files from the system owned by this user. Note: --remove-home does
not have an effect any more. If --backup is specified, the files are deleted after
having performed the backup.
<DT id="11"><B>--version</B>
<DD>
Display version and copyright information.
</DL>
<A NAME="lbAJ">&nbsp;</A>
<H2>RETURN VALUE</H2>
<DL COMPACT>
<DT id="12"><B>0</B>
<DD>
The action was successfully executed.
<DT id="13"><B>1</B>
<DD>
The user to delete was not a system account. No action was performed.
<DT id="14"><B>2</B>
<DD>
There is no such user. No action was performed.
<DT id="15"><B>3</B>
<DD>
There is no such group. No action was performed.
<DT id="16"><B>4</B>
<DD>
Internal error. No action was performed.
<DT id="17"><B>5</B>
<DD>
The group to delete is not empty. No action was performed.
<DT id="18"><B>6</B>
<DD>
The user does not belong to the specified group. No action was performed.
<DT id="19"><B>7</B>
<DD>
You cannot remove a user from its primary group. No action was performed.
<DT id="20"><B>8</B>
<DD>
The required perl-package 'perl modules' is not installed. This package is required to perform the requested actions. No action was performed.
<DT id="21"><B>9</B>
<DD>
For removing the root account the parameter &quot;--force&quot; is required. No action was performed.
<P>
</DL>
<A NAME="lbAK">&nbsp;</A>
<H2>FILES</H2>
<I>/etc/deluser.conf</I>
Default configuration file for deluser and delgroup
<DL COMPACT>
<DT id="22"><I>/usr/local/sbin/deluser.local</I>
<DD>
Optional custom add-ons.
<P>
</DL>
<A NAME="lbAL">&nbsp;</A>
<H2>SEE ALSO</H2>
<B><A HREF="/cgi-bin/man/man2html?8+adduser">adduser</A></B>(8),
<B><A HREF="/cgi-bin/man/man2html?5+deluser.conf">deluser.conf</A></B>(5),
<B><A HREF="/cgi-bin/man/man2html?8+groupdel">groupdel</A></B>(8),
<B><A HREF="/cgi-bin/man/man2html?8+userdel">userdel</A></B>(8)
<P>
<A NAME="lbAM">&nbsp;</A>
<H2>COPYRIGHT</H2>
Copyright (C) 2000 Roland Bauerschmidt. Modifications (C) 2004
Marc Haber and Joerg Hoh.
This manpage and the deluser program are based on adduser which is:
<BR>
Copyright (C) 1997, 1998, 1999 Guy Maor.
<BR>
Copyright (C) 1995 Ted Hajek, with a great deal borrowed from the original
Debian
<B>adduser</B>
<BR>
Copyright (C) 1994 Ian Murdock.
<B>deluser</B>
is free software; see the GNU General Public Licence version 2 or
later for copying conditions. There is
<I>no</I>
warranty.
<P>
<HR>
<A NAME="index">&nbsp;</A><H2>Index</H2>
<DL>
<DT id="23"><A HREF="#lbAB">NAME</A><DD>
<DT id="24"><A HREF="#lbAC">SYNOPSIS</A><DD>
<DL>
<DT id="25"><A HREF="#lbAD">COMMON OPTIONS</A><DD>
</DL>
<DT id="26"><A HREF="#lbAE">DESCRIPTION</A><DD>
<DL>
<DT id="27"><A HREF="#lbAF">Remove a normal user</A><DD>
<DT id="28"><A HREF="#lbAG">Remove a group</A><DD>
<DT id="29"><A HREF="#lbAH">Remove a user from a specific group</A><DD>
</DL>
<DT id="30"><A HREF="#lbAI">OPTIONS</A><DD>
<DT id="31"><A HREF="#lbAJ">RETURN VALUE</A><DD>
<DT id="32"><A HREF="#lbAK">FILES</A><DD>
<DT id="33"><A HREF="#lbAL">SEE ALSO</A><DD>
<DT id="34"><A HREF="#lbAM">COPYRIGHT</A><DD>
</DL>
<HR>
This document was created by
<A HREF="/cgi-bin/man/man2html">man2html</A>,
using the manual pages.<BR>
Time: 00:06:11 GMT, March 31, 2021
</BODY>
</HTML>