In Linux, a user-Linux general technology-Linux technology and application information is temporarily prohibited. The following is a detailed description. How to temporarily disable a user in Linux is to temporarily prevent the user from using the Linux system, rather than deleting it.
You can achieve this through the following two methods:
1. only remove the user's records from the/etc/passwd file, and keep the user's home directory and other files unchanged;
2. in the/etc/passwd file (or/etc/shadow), add a "*" before the first character of the passwd field of the user.
Note: This only disables a user. To delete a user, you need to delete the following items:
1. related user records in the/etc/passwd file;
2. the user information in the/etc/group file;
3. the user's home directory is generally in the/home directory;
4. files created by or belonging to the user.
The userdel command is used to delete users and their home directories.
Command format:
$ Userdel [-r] username
-R option: indicates that the user's home directory and its internal files will be deleted.
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