22

Magento prompts the password to be changes after 'X' days. How to change the value of admin dashboard password expiration period?

7 Answers 7

28

You can do this by following CLI commands

php bin/magento config:set admin/security/password_lifetime 0
php bin/magento config:set admin/security/password_is_forced 0
php bin/magento c:f

This helped me when my admin stuck in password change screen.

14

you can also do this thing by CLI:

php bin/magento config:set admin/security/password_lifetime 0

also make sure you clear your cache:

php bin/magento cache:clean
10

Admin: Stores -> Configuration -> Advanced -> Admin -> Security -> Password Lifetime(90 days by default)

2

The password lifetime is set by default to 90 days. To change the password expiration lifetime:

  • Go to Stores > Configuration > Advanced (Admin).
  • Under Security section, change the value of Password Lifetime (days).

You can also disable this feature by leaving the value of this field empty.

If you do not want to force admin user to change the password, then you can change the value of Password Change from Forced to Recommended.

1

The password lifetime is set by default to 90 days. It can be extended (or disabled) by going to Admin, Stores, Configuration, Admin, Security, Password Lifetime (days).

To disable this feature (not recommended) leave the field empty.

0

You could also change it in app/etc/config.php by changing the key admin/security/password_lifetime like this:

'admin' => [
    'security' => [
        'password_lifetime' => '0',
    ],
],

More information about this can be found in the Magento DevDocs page about other configuration paths.

Note that when you're in production mode you will have to clear caches and make a static-content deployment:

bin/magento setup:upgrade
bin/magento cache:clean
bin/magento cache:flush
bin/magento setup:static-content:deploy
0

You can add the following keys to env.php to make sure that it is disabled by default.
This has the added benefit that those settings can't be changed from the backend either, ensuring that an accidental change won't set you up for a redirect. disabled settings

<?php
return [
     ... other entries of env.php ...
     'system' => [
        'default' => [
            'admin' => [
                'security' => [
                    'password_is_forced' => 0,
                    'password_lifetime' => 0
                ]
            ]
        ]
    ]
];

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.