DbAppWeb.com

Menu
  • Home
  • Linux
  • HP-UX
  • macOS
  • Windows
  • Web Servers
  • App Servers
  • Storage

Turn Off Password Expiration for a User Account in RHEL

August 6, 2020 DbAppWeb Admin

To ensure the security of the systems we need to apply the password policy for user accounts on a Linux system. If the policy is applied and applicable to all user accounts then users need to change their password periodically as per policy. But in some cases where users need to access the system through tools or software with a saved password. In this case, if the password expired then users will not be able to connect to the system using that tools or software.

So, for the above scenario, we can disable or turn off the password expiry of that particular user account by using the command chage.

Turn Off Password Expiration in RHEL

First, check the password ageing details of the user sftp_test using chage command

[user@dbappweb.com ~]$ sudo chage -l sftp_test
Last password change                                    : May 05, 2020
Password expires                                        : Aug 03, 2020
Password inactive                                       : never
Account expires                                         : never
Minimum number of days between password change          : 1
Maximum number of days between password change          : 90
Number of days of warning before password expires       : 10

As you can see in the above details the password expiry was set for 90 days that’s why the user’s password expired after 90 days.

Use the below command to turn off the password expiration for user account sftp_test 

[user@dbappweb.com ~]$ sudo chage -M 99999 sftp_test

Now, you can see that Password expires has been set to never as shown below.

[user@dbappweb.com ~]$ sudo chage -l sftp_test
Last password change                                    : Aug 04, 2020
Password expires                                        : never
Password inactive                                       : never
Account expires                                         : never
Minimum number of days between password change          : 1
Maximum number of days between password change          : 99999
Number of days of warning before password expires       : 10

To set the password expiry, account expiry etc. use the command chage with the options, options details are given below.

[user@dbappweb.com ~]$ sudo chage 
Usage: chage [options] LOGIN

Options:
  -d, --lastday LAST_DAY        set date of last password change to LAST_DAY
  -E, --expiredate EXPIRE_DATE  set account expiration date to EXPIRE_DATE
  -h, --help                    display this help message and exit
  -I, --inactive INACTIVE       set password inactive after expiration
                                to INACTIVE
  -l, --list                    show account aging information
  -m, --mindays MIN_DAYS        set minimum number of days before password
                                change to MIN_DAYS
  -M, --maxdays MAX_DAYS        set maximim number of days before password
                                change to MAX_DAYS
  -R, --root CHROOT_DIR         directory to chroot into
  -W, --warndays WARN_DAYS      set expiration warning days to WARN_DAYS

Last Updated: August 06, 2020

Related Posts

  • Define Password Policy and Aging in Linux/RHEL 6

Share this:

  • Click to share on Twitter (Opens in new window)
  • Click to share on Facebook (Opens in new window)
  • Click to share on LinkedIn (Opens in new window)
  • Click to share on Telegram (Opens in new window)
  • Click to share on WhatsApp (Opens in new window)
Prev Article
Next Article
Tags:Linux RedHat Linux RHEL Sys Admin

Leave a Reply Cancel Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

  • Popular
  • Recent

Categories

  • Android (2)
  • Blogger (16)
  • Domain and Hosting (1)
  • Hardware Issues (7)
  • HP-UX (55)
  • HPE Data Protector (9)
  • IBM Lotus Notes (2)
  • IBM WebSphere Application Server (16)
  • Internet Tips & Tricks (15)
  • iOS (8)
  • JBoss/WildFly Application Server (2)
  • Linux (76)
  • macOS (15)
  • Microsoft Windows (31)
  • News and Updates (11)
  • Oracle Database (5)
  • SSL/TLS (1)
  • Storage Servers (23)
  • Tools/Softwares (1)
  • VMware ESXi (17)
  • Web Servers (14)
  • WordPress (5)

Archives

DbAppWeb.com

Solution of Database, Application and Web Server Problems

About DbAppWeb.com

One Stop Solution for Database Server, Application Server and Web Server Problems.

Subscribe to Blog via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

DbAppWeb on Social Media

Copyright © 2025 DbAppWeb.com
Terms and Conditions   Theme by MyThemeShop.com