{"id":628,"date":"2018-10-17T23:41:08","date_gmt":"2018-10-17T23:41:08","guid":{"rendered":"https:\/\/www.appservgrid.com\/paw92\/?p=628"},"modified":"2018-10-18T14:59:28","modified_gmt":"2018-10-18T14:59:28","slug":"how-to-force-user-to-change-their-password-on-next-login-in-linux","status":"publish","type":"post","link":"https:\/\/www.appservgrid.com\/paw92\/index.php\/2018\/10\/17\/how-to-force-user-to-change-their-password-on-next-login-in-linux\/","title":{"rendered":"how to force user to change their password on next login in linux ?"},"content":{"rendered":"<p>Method 1:<\/p>\n<p>To force a user to change his\/her password, first of all the password must have expired and to cause a user\u2019s password to expire, you can use the passwd command, which is used to change a user\u2019s password by specifying the -e or &#8211;expire switch along with username as shown.<\/p>\n<p>#passwd &#8211;expire ravi<\/p>\n<p>#chage -l ravi<\/p>\n<p>Last password change : password must be changed<\/p>\n<p>Password expires : password must be changed<\/p>\n<p>Password inactive : password must be changed<\/p>\n<p>Account expires : never<\/p>\n<p>Minimum number of days between password change : 0<\/p>\n<p>Maximum number of days between password change : 99999<\/p>\n<p>Number of days of warning before password expires : 7<\/p>\n<p>After running the passwd command above, you can see from the output of thechage command that the user\u2019s password must be changed. Once the userravi tries to login next time, he will be prompted to change his password before he can access a shell .<\/p>\n<p>Method 2:<\/p>\n<p>Using chage command:<\/p>\n<p>chage command \u2013 Change user password expiry information<\/p>\n<p>Use the following syntax to force a user to change their password at next logon on a Linux:<\/p>\n<p># chage -d 0 user-name<\/p>\n<p>In this example, force ravi to change his password at next logon, enter:<\/p>\n<p># chage -d 0 ravi<\/p>\n<ul>\n<li>-d 0 : Set the number of days since January 1st, 1970 when the password was last changed. The date may also be expressed in the format YYYY-MM-DD. By setting it to zero, you are going to force user to change password upon first login.<\/li>\n<\/ul>\n<p><a href=\"https:\/\/www.linuxforfreshers.com\/2018\/05\/how-to-force-user-to-change-their.html\" target=\"_blank\" rel=\"noopener\">Source<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Method 1: To force a user to change his\/her password, first of all the password must have expired and to cause a user\u2019s password to expire, you can use the passwd command, which is used to change a user\u2019s password by specifying the -e or &#8211;expire switch along with username as shown. #passwd &#8211;expire ravi &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.appservgrid.com\/paw92\/index.php\/2018\/10\/17\/how-to-force-user-to-change-their-password-on-next-login-in-linux\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;how to force user to change their password on next login 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-628","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\/628","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=628"}],"version-history":[{"count":1,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/628\/revisions"}],"predecessor-version":[{"id":755,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/628\/revisions\/755"}],"wp:attachment":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/media?parent=628"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/categories?post=628"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/tags?post=628"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}