Delete a user in Linux

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.