Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How does Linux delete the user completely?

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

This article introduces the knowledge of "how to delete users completely from Linux". In the operation of actual cases, many people will encounter such a dilemma. Then let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

1. First enter the system to create a user

[root@localhost /] # useradd # create user is the user name [root@localhost /] # passwd # set the password for this user and change the password of user . New password: * after the password is set, prompt "passwd: all authentication tokens have been updated successfully." Indicating that the password has been set successfully

2. Check the directory of some information about the user.

3. Delete a user

If you use the userdel command to delete the user, you cannot delete all the information of the user, just delete the information of the account and group in the four files / etc/passwd, / etc/shadow, / etc/group/, / etc/gshadow. By default, a user account is created, which creates a home directory and a user mailbox (named after the user name in the / var/spool/mail directory)

[root@localhost /] # userdel [root@localhost /] # cat / etc/passwd | grep [root@localhost /] # cat / etc/shadow | grep [root@localhost /] # cat / etc/group | grep [root@localhost /] # cat / etc/gshadow | grep [root@localhost /] # find /-name "* *"

The next time you create a user, it appears:

The error is reported in the image above, so you will report an error when you create the user account again, which means that the files or directories related to the user have not been deleted completely before.

4. Delete the user correctly

[root@localhost /] # userdel-r and then use the find command to view, user-related files have been deleted.

This is the end of the content of "how to completely delete users from Linux". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report