Objective
In the process of using the CentOS system, if you do not want to delete users, only temporarily or in the short term to prohibit a user login system, you can use the following two ways to achieve:
1, only the user's records removed from the /etc/passwd
file, leaving only its home directory and other documents unchanged;
2. In the /etc/passwd
file (or /etc/shadow
), the first character in the passwd field of the user is preceded by a "*" number.
Note: This only prohibits a user. If you want to remove a user, the items that need to be deleted include:
1. /etc/passwd
relevant user record in the document;
2, the /etc/group
file of the user's information;
3, the user's home directory, generally in the/home directory;
4, the user created, or belong to the user's file.
userdel
command is used to delete users and their home directories.
The command format is:
-r
Option: Indicates that the file with the home owner directory and its internals will be deleted.
Summarize
The above is about in the CentOS system temporarily prohibit the entire content of a user, I hope the content of this article for everyone's study or work can bring certain help, if you have questions you can message exchange.