Change RHEL Users Expiration Date

In RHEL (Red Hat Enterprise Linux), you can change a user’s expiration date using the terminal. Here’s how:
- Open a terminal…
- Switch to the root user or use a user with administrative privileges.
- To view the current expiration date for a user, use the
chagecommand with the-loption followed by the username:chage -l username - To change the expiration date for a user, use the chage command with the -E option followed by the new date in YYYY-MM-DD format:
chage -E YYYY-MM-DD usernameReplace YYYY-MM-DD with the desired expiration date and username with the actual username.
- Note: Make sure to choose an appropriate expiration date based on your requirements and security policies.
- Verify the changes by running the chage -l username command again.
chage -l usernameCongratulations. That’s it!!! You have successfully changed the expiration date for the RHEL user using the terminal.