CentOS system temporarily prohibits a user's method _linux

Source: Internet
Author: User

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:

$ userdel [-R] Username

-rOption: 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.

Related Article

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.