How to delete users and groups using userdel in Linux
Source: Internet
Author: User
In Linux, you cannot use userdel to delete users and groups. the solution is described as follows: when reading a book today, you can see an instance, which is followed by an itch... However, a problem occurs .. Users and Groups for testing cannot be deleted .. Situation: We usually remove the user from the group first ,... in Linux, you cannot use userdel to delete users and groups. the solution is described as follows: when reading a book today, you can see an instance, which is followed by an itch... However, a problem occurs .. Users and Groups for testing cannot be deleted .. Situation: Generally, when we remove a user from a group, the user is first deleted from the group, and then the group is killed in sequence... But the problem occurs .. Root @ crper-Aspire-5755G:/home/crper # userdel-r test1 userdel: user test1 is currently used by process 1 root @ crper-Aspire-5755G:/home/crper # groupdel work1 groupdel: you cannot remove the main group of user "test1" to delete the user. this reminds the user that the process is currently running... The solution for deleting his group also reported an error: After a long tangle, I suddenly remembered that I had seen a vipw command in a previous book .. Find man .... I started to work .. Root @ crper-Aspire-5755G:/home # vipw find the user you created before, delete that line with dd (remember to save: wq or: x ).. Later. Root @ crper-Aspire-5755G:/home # vipw-s find the user group, also dd to Kill (remember to save: wq or: x) why vipw-s? There is only one reason, must ensure data consistency, otherwise it may cause a system crash or some inexplicable problem command: root @ crper-Aspire-5755G:/home # vipw -- help usage: vipw [option] option:-g, -- group Edit group Database-h, -- help display this help information and release-p, -- passwd edit passwd database-q, -- quiet mode-R, -- root CHROOT_DIR chroot Directory-s, -- shadow edit shadow or gshadow database
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.