How Linux disables accounts and disables accounts

Source: Internet
Author: User
There are several ways to disable your account:
1. # usermod-l <username>
# usermod-u <username> //de-disable
2. Modify the/etc/passwd file, there can be several places
1) Change the "X" in the second field to another character, and the account will not be able to log in
2) Change the/bin/bash into/sbin/nologin
3. Modify the/etc/shadow file
1) in the second password field before adding a "!", the account will not be able to log in, this is actually the result of the usermod-l command
2) Add the number "1" between the last two colons, indicating that the password for the account expires immediately after one day from January 1, 1970, and of course it is not possible to log in now.
If you want to lift the ban, remove the modified things.

How Linux disables accounts and disables accounts

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.