Linux User Password Management

Source: Internet
Author: User

An important part of user management is the management of user passwords.

A user account is locked by the system and cannot be used without a password. It can be used only after a password is specified, even if it is a blank password.

The shell command used to specify and modify the user password is passwd. Super Users can specify passwords for themselves and other users. Common users can only modify their own passwords.

Command Format:

Code: passwd option User Name

Available options:

-L the password is disabled.

-U password unlock.

-D indicates that the account has no password.

-F forces the user to change the password upon next login.

 

If the default user name is used, modify the password of the current user.

For example, if the current user is Sam, the following command modifies the user's own password:

$Passwd

Old password:

******

New password:

*******

Re-enter new password:

*******

If you are a super user, you can specify the password of any user in the following form:

#Passwd Sam

New password:

*******

Re-enter new password:

*******

 

When a common user modifies his or her own password, the passwd command First asks for the original password and then asks the user to enter the new password twice. If the two passwords are the same, the original password is not required when the superuser specifies a password for the user.

For the sake of security, you should select a complicated password. It is best to use a password of no less than 8 digits. The password contains uppercase letters, lowercase letters, and numbers, it should be different from the name and birthday.

When you specify a blank password for a user, run the following command: Code: # passwd-d sam: This command deletes the password of the user Sam, so that the user Sam will log on to the next time, the system no longer asks for the password. The passwd command can also use the-l (LOCK) option to lock a user so that the user cannot log on. For example, code: # passwd-l Sam

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.