1USERDEL(8) System Management Commands USERDEL(8)
2
3
4
6 userdel - delete a user account and related files
7
9 userdel [options] LOGIN
10
12 The userdel command modifies the system account files, deleting all
13 entries that refer to login_name. The named user must exist.
14
16 The options which apply to the userdel command are:
17
18 -f, --force
19 This option forces the removal of the user, even if she is still
20 logged in. It also forces userdel to remove the user's home
21 directory or her mail spool, even if another user uses the same home
22 directory or if the mail spool is not owned by the specified user.
23 If USERGROUPS_ENAB is defined to yes in /etc/login.defs and if a
24 group exists with the same name as the deleted user, then this group
25 will be removed, even if it is still the primary group of another
26 user.
27
28
29 Note: This option is dangerous and may leave your system in an
30 inconsistent state.
31
32 -h, --help
33 Display help message and exit.
34
35 -r, --remove
36 Files in the user's home directory will be removed along with the
37 home directory itself and the user's mail spool. Files located in
38 other file systems will have to be searched for and deleted
39 manually.
40
41 The mail spool is defined by the MAIL_DIR variable in the login.defs
42 file.
43
45 /etc/group
46 Group account information.
47
48 /etc/login.defs
49 Shadow password suite configuration.
50
51 /etc/passwd
52 User account information.
53
54 /etc/shadow
55 Secure user account information.
56
58 The userdel command exits with the following values:
59
60 0 success
61
62 1 can't update password file
63
64 2 invalid command syntax
65
66 6 specified user doesn't exist
67
68 8 user currently logged in
69
70 10 can't update group file
71
72 12 can't remove home directory
73
75 userdel will not allow you to remove an account if the user is
76 currently logged in. You must kill any running processes which belong
77 to an account that you are deleting.
78
79 You may not remove any NIS attributes on a NIS client. This must be
80 performed on the NIS server.
81
82 If USERGROUPS_ENAB is defined to yes in /etc/login.defs, userdel will
83 delete the group with the same name as the user. To avoid
84 inconsistencies in the passwd and group databases, userdel will check
85 that this group is not used as a primary group for another user, and
86 will just warn without deleting the user otherwise. The -f option can
87 force the deletion of this group.
88
90 chfn(1), chsh(1), passwd(1), login.defs(5), gpasswd(8), groupadd(8),
91 groupdel(8), groupmod(8), useradd(8), usermod(8).
92
93
94
95System Management Commands 07/30/2006 USERDEL(8)