Delete a user in Linux. delete a user in Linux. You cannot just delete the user from the user's home directory. to delete a user completely, delete the following: 1. delete user records in the/etc/passwd file; 2. delete user records in the/etc/shadow file. 3. delete group records with the same name in/etc/group. 4. delete the user's home directory. Run the "rm-rf/home/User Name" command to delete the user's home directory. 5. delete users' emails. Generally, users' emails are stored in the/var/spool/mail directory. The DELETE command is rm/var/spool/mail/user name, of course, you can also add the-rf parameter option to the rm command; 6. delete the Background Program executed by the user. To avoid executing the current program in the system, you can use ps, grep, and kill to delete it. For example: ps-aux | grep "User Name" kill pid; for example, kill-9 1694, where "-9" indicates that the program is forcibly deleted. 7. delete the crontab settings. If you have used crontab to set a timer, You can regularly start some tasks, in the/var/spool/cron directory, a file with the same name as the user exists. Delete the command: rm/var/spool/cron/user name or/usr/bin/crontab-u user name-d