The passwd of Linux command detailed

Source: Internet
Author: User

Role: Modify user password

Format: passwd [options] [LOGIN]

Describe:

Ordinary users can only modify their own password, Superuser can modify the password of any account, can also change the validity of the relevant account password;

Superuser can not enter the password of the user to be modified;

Options:

-A,--All

Use with-S to show all user status

-D,--Delete

Delete User Password

-E,--expire

Disable the user's password immediately, forcing the user to modify the password at the next logon

-H,--Help

Display Help information and exit

-I,--inactive inactive

When the account expires inactive, users can no longer use the account login

-N,--mindays min_days

Password two times to modify the time at least interval min_days days, if Min_days is 0, it can be modified at any time

-S,--Status

Displays account status information, a total of 7 fields, namely login name, L (P or NP), last modified time, minimum age, maximum age, warning period, inactive period. The units of these ages are all days.

-W,--warndays warn_days

Warn Warn_days days before password expires

-X,--maxdays max_days

Set the maximum lifetime of a password

File:

/etc/passwd

User account information

/etc/shadow

Encrypt user account information

/etc/pam.d/passwd

Pam Configuration for passwd

Exit Value:

0: Success

1: Access Denied

2: Option binding is not valid

3: Unknown failure, nothing done

4: Unknown failure, passwd file missing

5:PASSWD file is occupied, try again

6: Option has invalid parameter

Example:

View all user Information

Sudo--status--all

Modify 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.