SYS: Change passwords and adjust password aging for local user accounts.

Share this link

Note: This is an RHCSA 7 exam objective.

To assign a password to a user account (here user), type:

# passwd user

To set an expiration date to a local user account (here user), type:

# chage -E YYYY-MM-DD user

To check the result, type:

# chage -l user
1 Star2 Stars3 Stars4 Stars5 Stars (3 votes, average: 3.67 out of 5)
Loading...
5 comments on “SYS: Change passwords and adjust password aging for local user accounts.
  1. hunter86_bg says:

    “chage -d 0 username” requires the user to change his password immediately after logon, which is a quite a nice feature.

  2. hpardis says:

    Is there an actual difference between using passwd -x 0 username and chage -E YYYY-MM-DD user?

    Also, in case it helps anyone, you can use date -d ’90 days’ for example, if you need to find the exact date 90 days from now to use with something like chage.

    • CertDepot says:

      I have to say that I didn’t know the passwd -x command. With this command and according to the man page, you can set the maximum password lifetime in days, when you specify a date or a number of days since January 1, 1970 with the chage -E command. In one case, it is a number of days from now, in the other case, a date in the future. At the end, you should get the same result.

  3. itninja says:

    echo Y0uRp@$$w0rD | passwd –stdin useraccount
    Seems useful for scripting.

Leave a Reply

Upcoming Events (Local Time)

There are no events.

RHCSA7: Task of the day

Allowed time: 10 minutes.
Archive and compress the content of the /opt directory (create files if none exists).
Uncompress and unarchive the resulting file in /root

RHCE7: Task of the day

Allowed time: 10 minutes.
Set up a caching-only DNS server to forward DNS queries.

Follow me on Twitter

Poll for favorite RHEL 7 book

What is your favorite RHEL 7 book to prepare RHCSA & RHCE exams?

View Results

Loading ... Loading ...

Poll for most difficult RHCSA 7 topic

What do you think is the most difficult RHCSA 7 topic?

View Results

Loading ... Loading ...

Poll for most difficult RHCE 7 topic

What do you think is the most difficult RHCE 7 topic?

View Results

Loading ... Loading ...