{"id":13593,"date":"2019-04-03T11:21:47","date_gmt":"2019-04-03T11:21:47","guid":{"rendered":"http:\/\/www.appservgrid.com\/paw92\/?p=13593"},"modified":"2019-04-03T11:21:47","modified_gmt":"2019-04-03T11:21:47","slug":"how-to-manage-user-password-expiration-and-aging-in-linux","status":"publish","type":"post","link":"https:\/\/www.appservgrid.com\/paw92\/index.php\/2019\/04\/03\/how-to-manage-user-password-expiration-and-aging-in-linux\/","title":{"rendered":"How to Manage User Password Expiration and Aging in Linux"},"content":{"rendered":"<p>System administration involves numerous tasks including managing users\/groups and under user management, some of the minor tasks involved are adding, modifying, suspending, or deactivating user accounts, and many more.<\/p>\n<p>This article will explain one of the critical user account management functions, how to set or change user password expiration and aging in Linux using the\u00a0<strong>chage command<\/strong>.<\/p>\n<p><strong>Read Also<\/strong>:\u00a0<a href=\"https:\/\/www.tecmint.com\/rhcsa-exam-manage-users-and-groups\/\" target=\"_blank\" rel=\"noopener\">How to Manage Users and Groups in Linux<\/a><\/p>\n<p>The\u00a0<strong>chage command<\/strong>\u00a0is used to modify user password expiry information. It enables you to view user account aging information, change the number of days between password changes and the date of the last password change.<\/p>\n<p>Once you have set password expiry and aging information, this information is used by the system to determine when a user must change his\/her password. Normally, companies or organizations have certain security polices that demand users to change passwords regularly: this can be a simple way to enforce such policies as we explained below.<\/p>\n<p>To view a user account aging information, use the\u00a0<code>-l<\/code>\u00a0flag as shwon.<\/p>\n<pre># chage -l ravi\r\n<\/pre>\n<div id=\"attachment_28678\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/02\/view-user-password-aging-informatio.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-28678\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/02\/view-user-password-aging-informatio.png\" alt=\"View User Password Aging Information\" width=\"732\" height=\"173\" aria-describedby=\"caption-attachment-28678\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-28678\" class=\"wp-caption-text\">View User Password Aging Information<\/p>\n<\/div>\n<p>To set the date or number of days (since\u00a0<strong>January 1, 1970<\/strong>) when the password was last changed, use the\u00a0<code>-d<\/code>flag as follows.<\/p>\n<pre># chage -d 2018-02-11 ravi\r\n<\/pre>\n<p>Next, you can also set the date or number of days (since\u00a0<strong>January 1, 1970<\/strong>) on which the user\u2019s account will no longer be accessible by using the\u00a0<code>-E<\/code>\u00a0switch as shown in the following command.<\/p>\n<p>In this case, once a user\u2019s account is locked, he\/she is required to contact the system administrator before being able to use the system again.<\/p>\n<pre># chage -E 2018-02-16 ravi\r\n<\/pre>\n<p>Then, the\u00a0<code>-W<\/code>\u00a0option allows you to set the number of days of warning before a password change is required. Considering the command below, the user\u00a0<strong>ravi<\/strong>\u00a0will be warned\u00a0<strong>10<\/strong>\u00a0days prior to his password expiring.<\/p>\n<pre># chage -W 10 ravi\r\n<\/pre>\n<p>In addition, you can set the number of days of inactivity after a password has expired before the account is locked. This example means that after user ravi\u2019s password expires, his account will be inactive for\u00a0<strong>2<\/strong>\u00a0days before it is locked.<\/p>\n<p>When the account becomes inactive, he must contact the system administrator before being able to use the system again.<\/p>\n<pre># chage -I 2 ravi\r\n<\/pre>\n<p>For more information, refer to the\u00a0<strong>chage man<\/strong>\u00a0page.<\/p>\n<pre># man chage\r\n<\/pre>\n<p>Note that you can also change a user\u2019s password expiration and aging information using the\u00a0<a href=\"https:\/\/www.tecmint.com\/usermod-command-examples\/\" target=\"_blank\" rel=\"noopener\">usermod command<\/a>, which is actually intended for modifying a user account.<\/p>\n<p>Also check out:<\/p>\n<ol>\n<li><a href=\"https:\/\/www.tecmint.com\/manage-users-and-groups-in-linux\/\" target=\"_blank\" rel=\"noopener\">Managing Users &amp; Groups, File Permissions &amp; Attributes on User Accounts<\/a><\/li>\n<li><a href=\"https:\/\/www.tecmint.com\/find-user-account-info-and-login-details-in-linux\/\" target=\"_blank\" rel=\"noopener\">11 Ways to Find User Account Info and Login Details in Linux<\/a><\/li>\n<\/ol>\n<p>That\u2019s it for now. Hoping you find this article informative and useful, if you have any questions to ask, use the feedback form below.<\/p>\n<p><a href=\"https:\/\/www.tecmint.com\/manage-user-password-expiration-and-aging-in-linux\/\" target=\"_blank\" rel=\"noopener\">Source<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>System administration involves numerous tasks including managing users\/groups and under user management, some of the minor tasks involved are adding, modifying, suspending, or deactivating user accounts, and many more. This article will explain one of the critical user account management functions, how to set or change user password expiration and aging in Linux using the\u00a0chage &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.appservgrid.com\/paw92\/index.php\/2019\/04\/03\/how-to-manage-user-password-expiration-and-aging-in-linux\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;How to Manage User Password Expiration and Aging in Linux&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-13593","post","type-post","status-publish","format-standard","hentry","category-linux"],"_links":{"self":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/13593","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/comments?post=13593"}],"version-history":[{"count":1,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/13593\/revisions"}],"predecessor-version":[{"id":13594,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/13593\/revisions\/13594"}],"wp:attachment":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/media?parent=13593"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/categories?post=13593"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/tags?post=13593"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}