Passwd for Linux Commands

Source: Internet
Author: User
& Amp; 65279; & amp; 65279; role: change user password & amp; 26684; formula: passwd [options] [LOGIN] description: normal users can only change their own passwords; A super user can change the password of any account or the validity period of the password. a super user can

Purpose: modify the user password.

Format: passwd [options] [LOGIN]

Description:

Normal users can only change their own passwords. super users can change the passwords of any account or change the validity period of the passwords;

Super users do not need to enter the password of the user to be modified;

Option:

-A, -- all

Used with-S to display the status of all users

-D, -- delete

Delete user password

-E, -- expire

Immediately invalidates the user password and forces the user to change the password upon next login

-H, -- help

Show Help information and exit

-I, -- inactive INACTIVE

After the account becomes INACTIVE, the user cannot use the account to log on again.

-N, -- mindays MIN_DAYS

The password must be modified at least within MIN_DAYS. if MIN_DAYS is 0, the password can be modified at any time.

-S, -- status

The account status information is displayed in seven fields: logon name, L (P or NP), Last modification time, minimum age, maximum age, warning period, and inactive period. The units of these ages are all days.

-W, -- warndays WARN_DAYS

WARN_DAYS days warning before password failure

-X, -- maxdays MAX_DAYS

Set the maximum password validity period

File:

/Etc/passwd

User account information

/Etc/shadow

Encrypt user account information

/Etc/pam. d/passwd

PAM configuration of passwd

Exit value:

0: Successful

1: Access Denied

2: invalid option combination

3: Unknown failure, nothing done

4: Unknown failure, passwd file loss

5: The passwd file is occupied. try again

6: The option has invalid parameters.

Example:

View all user information

Sudo -- status -- all

Change current user password

Passwd

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.