• Home
  • Disclaimer
  • Contact
  • Archives
  • About
  • Subscribe
  • Support
  • Advertise

Kernel Talks

Unix, Linux, & Cloud!

  • How-to guides
    • Howto
    • Disk management
    • Configurations
    • Troubleshooting
  • OS
    • HPUX
    • Linux
  • Miscellaneous
    • Software & Tools
    • Cloud Services
    • System services
    • Virtualization
  • Certification Preparations
    • AWS Certified Solutions Architect – Associate
    • AWS Certified Solutions Architect – Professional
    • AWS Certified SysOps Administrator – Associate
    • AWS Certified Cloud Practitioner
    • Certified Kubernetes Administrator
    • Hashicorp Certified Terraform Associate
    • Oracle Cloud Infrastructure Foundations 2020 – Associate
  • Tips & Tricks
  • Linux commands
You are here: Home / User management

How to remove password expiry in linux

Published: September 21, 2016 | Modified: June 20, 2020



Know how to remove password expiry in a Linux system. This is helpful in setting app accounts that need non-expiry passwords to run.

Requirement :

To set never expire attribute on account password. Some applications/users are required to have the same password for a longer duration. This requires them to exit from the system-wide password expiry policy. So that those accounts can run a lifetime without the need of changing their passwords.

How to do it :

Check the account’s current policy.

# chage -l testuser

Last password change                                    : Sep 01, 2016
Password expires                                        : Oct 04, 2016
Password inactive                                       : never
Account expires                                         : never
Minimum number of days between password change          : 0
Maximum number of days between password change          : 33
Number of days of warning before password expires       : 7

Here the second line shows when the password is expiring post which user will be prompted to set a new password. Set password to never expire with below command

# chage -M -1 testuser

Verify changes in the account. Note here in output, Password expires field changed its value to never.

# chage -l testuser

Last password change                                    : Sep 01, 2016
Password expires                                        : never
Password inactive                                       : never
Account expires                                         : never
Minimum number of days between password change          : 0
Maximum number of days between password change          : 33
Number of days of warning before password expires       : 7
⇠ Previous article
Get list of desired LUN id from powermt output
Next article ⇢
How to generate CSR file for SSL request on Linux

Related stuff:

  • How to configure NTP client in Linux
  • Format date and time for Linux shell script or variable
  • How to remove product channels in Suse Manager
  • Root disk mirroring in itanium HPUX
  • How to upgrade SUSE 12 SP1 to SP3 or SP4
  • 5 steps guide for SMTP configuration in Linux
  • Execute command at shutdown and boot in Suse Linux
  • Preparing for Hashicorp Certified Terraform Associate Exam
  • How to configure nameserver in Linux
  • How to remount filesystem in the read-write mode under Linux
  • Move disks/LUN from one server to another without losing data
  • All you need to know about hostname in Linux

Filed Under: Howto, Linux, User management Tagged With: chage command, How to remove password expiry, How to set non-expiry password, Linux account management, Never expire password in Linux, password expiry

If you like my tutorials and if they helped you in any way, then

  • Consider buying me a cup of coffee via paypal!
  • Subscribe to our newsletter here!
  • Like KernelTalks Facebook page.
  • Follow us on Twitter.
  • Add our RSS feed to your feed reader.

Share Your Comments & Feedback: Cancel reply

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

Get fresh content from KernelTalks

  • Email
  • Facebook
  • RSS
  • Twitter

Get Linux & Unix stuff right into your mailbox. Subscribe now!

* indicates required

This work is licensed under a CC-BY-NC license · Privacy Policy
© Copyright 2016-2023 KernelTalks · All Rights Reserved.
The content is copyrighted to Shrikant Lavhate & can not be reproduced either online or offline without prior permission.