"Linux learning is not difficult" user management (7): Set or modify user passwords

Source: Internet
Author: User

9.7 User Management (7): Set or modify user passwords

Use the passwd command to set or modify the user's password, both ordinary and super-privileged users can run passwd, ordinary users can only change their own user password, the root user can set or modify any user's password.

If the passwd command is not followed by any option or user name, the current user's password is modified.

Command syntax:

passwd [Options] [user name]

The meanings of the options in the command are as shown in the table.

Options

option meaning

-D

Delete user password, can only be operated as root user

-L

Lock the password of the user account

-U

Unlock password for user account

-E

Terminate the password for the named account

-X < days >

Maximum effective time limit for passwords

-N < days >

Minimum effective time limit for passwords

-W < days >

Start reminding users how many days before the password expires

-I < days >

How many days after the password expires the account will be disabled

-S

Querying the user's password status


Example: Set the user's it password.

[Email protected] ~]# useradd it [[email protected] ~]# passwd It changes user it's password. New Password://Enter the user's it password to reenter the new password://Enter the user it password passwd: All authentication tokens have been successfully updated.

Example: Lock the user's it password.

[[email protected] ~]# passwd-l It locks the password of the user it. PASSWD: Successful operation

Example: Unlocking the user's it password.

[[email protected] ~]# Passwd-u It unlocks the password of the user it. PASSWD: Successful operation


  this excerpt from linux learning linux introductory textbook. To read the entire book, please visit OPS ( www.linuxywz.com

"Linux learning is not difficult" user management (7): Set or modify user password

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.