DELUSER(8)
๐ DELUSER(8) โ ok bestie, we're removing users and groups ๐
Hiii so you're in section 8 of the manual (that's the system manager's one, aka the big-kid admin stuff โจ), and the page is called DELUSER(8). Sit with me, grab a boba, and let's get you deleting accounts like the icon you are ๐ซถ
๐ธ NAME ๐ธ
deluser, delgroup โ remove a user or group from the system ๐ง
โจ SYNOPSIS โจ
Like, here's every single way you can call it. No shortcuts, all of it:
deluser [--backup] [--backup-suffix str] [--backup-to dir] [--conf file]
[--debug] [--remove-all-files] [--remove-home] [--quiet]
[--verbose] [--stdoutmsglevel prio] [--stderrmsglevel prio]
[--logmsglevel prio] [--lock] user
deluser [--system] [--backup] [--backup-suffix str] [--backup-to dir]
[--conf file] [--debug] [--remove-all-files] [--remove-home]
[--quiet] [--verbose] [--stdoutmsglevel prio]
[--stderrmsglevel prio] [--logmsglevel prio] [--lock]
[--force-delete] user
deluser --group [--conf file] [--debug] [--only-if-empty] [--quiet]
[--verbose] [--stdoutmsglevel prio] [--stderrmsglevel prio]
[--logmsglevel prio] group
delgroup [--system] [--conf file] [--debug] [--only-if-empty] [--quiet]
[--verbose] [--stdoutmsglevel prio] [--stderrmsglevel prio]
[--logmsglevel prio] group
deluser [--conf file] [--debug] [--quiet] [--verbose]
[--stdoutmsglevel prio] [--stderrmsglevel prio]
[--logmsglevel prio] user group
deluser --help
deluser --version
๐ฆ DESCRIPTION ๐ฆ
So deluser and delgroup remove users and groups from the system, and they do it according to whatever you put on the command line plus the config info living in /etc/deluser.conf and /etc/adduser.conf. ๐
They're, like, more Debian specific front ends to the userdel and groupdel programs โ and those two are the more distribution agnostic ones. The tea โ: deluser and delgroup can remove the home directory as an option, or even all the files on the system owned by the user you're removing, plus they can run a custom script, and they have other features too. Obsessed, honestly.
For a full list and explanations of all options, see the OPTIONS section (it's right below, bestie, don't scroll past it ๐).
deluser and delgroup can be run in one of three modes:
๐ Remove a user
If you call deluser with one non-option argument and without the --group option, deluser will remove a non-system user.
Note: Ifdeluseris called with the--lockoption, the user account will be locked rather than removed as described here; see--lock, below. โ ๏ธ
By default, deluser will remove the user without removing the home directory, the mail spool, or any other files on the system owned by that user. If you wanna take the home directory and mail spool out too, that's the --remove-home option. ๐
The --remove-all-files option removes all files on the system owned by the user. Note that if you activate both options, --remove-home will have no additional effect, because all files including the home directory and mail spool are already covered by the --remove-all-files option. No double-dipping, she's already doing the most. ๐
If you want to back up all files before deleting them, you can activate the --backup option, which will create a file username.tar(.gz|.bz2) in the directory specified by the --backup-to option. Cute AND safe, we love a responsible queen. ๐
By default, the backup archive is compressed with gzip(1). To change this, the --backup-suffix option can be set to any suffix supported by tar --auto-compress.
deluser will refuse to remove the root account. ๐ซ Not today, not ever, absolutely not.
If the --system option is given on the command line, the delete operation is actually executed only if the user is a system user. This avoids accidentally deleting non-system users. Additionally, if the user does not exist, no error value is returned. Debian package maintainer scripts may use this flag to remove system users or groups while ignoring the case where the removal already occurred. Very much "if it's already gone then it's already gone, no drama" energy. โจ
๐ Remove a group
If deluser is called with the --group option, or delgroup is called, a group will be removed. The primary group of an existing user cannot be removed. And if the option --only-if-empty is given, the group won't be removed if it has any members left. ๐ซถ
The --system option adds the same functionality as for users, respectively.
๐ Remove a user from a specific group
If called with two non-option arguments, deluser will remove a user from a specific group. Just one lil group membership, plucked out. ๐
๐ OPTIONS ๐
Different modes of deluser allow different options. If no valid modes are listed for an option, it is accepted in all modes. (So when it's blank, she's universal, she's for everyone. ๐)
Short versions for certain options may exist for historical reasons. They are going to stay supported, but are removed from the documentation. Users are advised to migrate to the long version of options. (Grandfathered in, but like, read the room and move on. ๐)
--backupโ Backup all files contained in the userhome and the mailspool file to a file namedusername.tar.bz2orusername.tar.gz. Valid modes:deluser,deluser --system.--backup-suffix strโ Select compression algorithm for a home directory backup. Can be set to any suffix recognized bytar --auto-compress. Defaults to.gz. Valid modes:deluser,deluser --system.--backup-to dirโ Place the backup files not in the current directory but in dir. This implicitly sets--backupalso. Defaults to the current working directory. Valid modes:deluser,deluser --system.--conf fileโ Use file instead of the default files/etc/deluser.confand/etc/adduser.conf. Multiple--confoptions may be given. (Stack 'em, bestie ๐ )--debugโ Synonymous to--stdoutmsglevel=debug. Deprecated.--groupโ Remove a group. This is the default action if the program is invoked asdelgroup. Valid mode:deluser.--helpโ Display brief instructions. ๐ซถ--only-if-emptyโ Only remove if no members are left. Valid modes:deluser --group,delgroup.--quietโ Synonymous to--stdoutmsglevel=warn. Deprecated.--remove-all-filesโ Remove all files from the system owned by this user. Note:--remove-homedoes not have an effect any more. If--backupis specified, the files are deleted after having performed the backup. Valid modes:deluser,deluser --system.--remove-homeโ Remove the home directory of the user and its mailspool. If--backupis specified, the files are deleted after having performed the backup. Valid modes:deluser,deluser --system.--systemโ Only delete if user/group is a system user/group. If the user does not exist, no error value is returned. Valid modes:deluser,deluser --system.--verboseโ Synonymous to--stdoutmsglevel=info. Deprecated.--stdoutmsglevel prio,--stderrmsglevel prio,--logmsglevel prioโ Minimum priority for messages logged to syslog/journal and the console, respectively. Values aretrace,debug,info,warn,err, andfatal. Messages with the priority set here or higher get printed to the respective medium. Messages printed to stderr are not repeated on stdout. That allows the local admin to control adduser's chattiness on the console and in the log independently, keeping probably confusing information to itself while still leaving helpful information in the log. ๐ฅ--lockโ Ifdeluseris called with the--lockoption, the user account will be locked rather than removed. In this case, the user's password is invalidated and the account is set to expired; no other action is taken. A locked account may be subsequently unlocked usingadduser --unlock.
System users may be set to lock upon delete by default by setting SYS_DELETE_ACTION=lock in /etc/deluser.conf. ๐
--force-deleteโ If deleting a system user, and the defaultSYS_DELETE_ACTIONwould lock the account, instead delete it normally. ๐ฅ--versionโ Display version and copyright information.
๐ LOGGING ๐
deluser uses extensive and configurable logging to tailor its verbosity to the needs and wishes of the system administrator.
This works similar to adduser. See adduser(8) for all the details. ๐
โญ EXIT VALUES โญ
The exit values documented in adduser(8) also apply for deluser.
๐ฅ SECURITY ๐ฅ
ok bestie this one is serious, listen up fr fr:
deluser needs root privileges and offers, via the --conf command line option, to use different configuration files. Do not use sudo(8) or similar tools to give partial privileges to deluser with restricted command line parameters. This is easy to circumvent and might allow users to obtain privileges they are not supposed to have.
๐จ If you want this, consider writing your own wrapper script and giving privileges to execute that script. Do it properly or don't do it at all, periodt. ๐
๐ FILES ๐
/etc/deluser.confโ Default configuration file fordeluser(8)anddelgroup(8)/usr/local/sbin/deluser.localโ Optional custom add-ons, seedeluser.local(8)
๐ธ SEE ALSO ๐ธ
adduser(8), deluser.conf(5), deluser.local.conf(8), groupdel(8), userdel(8)
and that's the whole page, you ate that ๐โจ this one's from the Debian GNU/Linux girlies, living in the System Manager's Manual, filed under DELUSER(8) โ mwah, go forth and delete responsibly ๐๐ฆ๐
๐ฆ where this page comes from
- ubuntu stonking: adduser 3.157ubuntu2 ยท GPL-2.0-or-later
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms