• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

CentOS / RHEL : How to configure a user account to never expire (disable password ageing)

by admin

Question : How to configure a user account so that the password will never expire?

Answer:

By default passwords do not expire on user accounts. If an expiration date has been added to an account and you wish to remove it use either the passwd or chage commands to change the maximum number of days between password changes to -1.

For example, modifying the user “krishna” whose account is currently set to expire in 30 days:

# chage -l krishna
Minimum: 0
Maximum: 30
Warning: 7
Inactive: -1
Last Change: Nov 19, 2007
Password Expires: Dec 19, 2007
Password Inactive: Never
Account Expires: Never

As you can see from the output above, the maximum number of days between password changes is set to 30 days. Modify the maximum days so that the password does not expire:

# passwd -x -1 krishna

or

# chage -M -1 krishna

Verify

Verify the new value of “maximum number of days between password changes”. It should be -1.

# chage -l krishna
Minimum: 0
Maximum: -1
Warning: 7
Inactive: -1
Last Change: Nov 19, 2007
Password Expires: Never
Password Inactive: Never
Account Expires: Never
Solaris : How to configure a user account to never expire (disable password aging)

Filed Under: Linux

Some more articles you might also be interested in …

  1. Difference between absolute and relative paths in Linux
  2. Changing the IPset rules from IPtables to Firewalld in CentOS/RHEL 7
  3. How to move /var on a separate disk as a separate mount point (Online)
  4. Nginx load balancing
  5. How To Check a Disk for Bad Blocks or Disk Errors on CentOS / RHEL
  6. How to Use iptables instead of firewalld on CentOS/RHEL 7 and 8
  7. What’s the difference between locate and find command in Linux
  8. What are sparse files in Linux
  9. Oracle Software Group Accounts OSDBA, OSOPER, Oracle Inventory group
  10. showmount Command Examples in Linux

You May Also Like

Primary Sidebar

Recent Posts

  • grpck command – Remove corrupt or duplicate entries in the /etc/group and /etc/gshadow files.
  • xxd command – Expressed in hexadecimal form
  • sesearch: command not found
  • macof: command not found

© 2022 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright