17

When trying to login to admin account in my local test setup it says : Account is temporarily disabled even i used correct user and password.

31

After some search on the internet, I found that due to security reasons Magento has introduced account disabled functionality with considering the security of the business.

Here is how you can unlock and Go to your Magento root folder via SSH/PUTTY

Then Run following command

php bin/magento admin:user:unlock ADMINUSERNAME

Or jump into bin directory from Magento root: cd bin/

and then run the command

php magento admin:user:unlock ADMINUSERNAME

For Reference, check here http://devdocs.magento.com/guides/v2.0/install-gde/install/cli/install-cli-subcommands-admin.html

15

Please try to reset username and password . I have tried the following code that works for me.

sudo php bin/magento admin:user:create --admin-user="pearlbells" --admin-password="pear122l**all" --admin-email="pearl@gmail.com" --admin-firstname="Admin" --admin-lastname="Admin"
  • This solution worked for me – WaPoNe Jul 26 '17 at 13:52
  • Is this working on magento enterprise version? – Camit1dk Aug 3 '17 at 6:51
  • Billion Thanks.This saved my time @Liz Eipe C – anil Sep 27 '18 at 12:03
6

I struggled to solve this when working with multiple environments, and I think Jairmin's answer might help stop this happen, but once it has I found the following steps solved the problem:

  • Try what Yogesh Trivedi suggested, though this did not work for me

If that did not help, do the next 3 in order without trying to login in between:

  • Truncate the mage_admin_user_session table
  • In the mage_admin_user table reset failures_num to 0 and first_failure to NULL for the relevant user(s)
  • Reset password via the front end option (not directly in the DB)

This is obviously fairly aggressive and should only be done if you haven't been able to get in any other way.

  • my answer was for to unlock user which is locked it means you can not login to admin panel with that particular user, so first you need to unlock the user then only you can login and follow the Jaimin's step for configuring password life. – Yogesh Trivedi May 23 '17 at 6:42
  • @YogeshTrivedi I've had it whereby you have the exact same thing, message on logging into the admin panel, but unlocking the user like you described had no effect. – tim.baker May 23 '17 at 6:43
  • i am not sure but it worked for me and i got to learn this from Magento official website, check it here - devdocs.magento.com/guides/v2.0/install-gde/install/cli/… – Yogesh Trivedi May 23 '17 at 10:08
4

In magento 2, there is configuration for set Password Lifetime (days). It means if user didn't login in admin specific days then account will be locked.

For set this days go to Stores > Configuration > Advanced > Admin > Security and set value for Password Lifetime (days) .

2

I tried this options and various other options but none worked for me :

I followed this :

1./opt/bitnami/apps/magento/htdocs/vendor/zendframework/zend-crypt/src

updated utils.php to following:

Go to this file path and \vendor\zendframework\zend-crypt\src\Utils.php and echo $expected and $actual variable and check both are same or not if both variable are not match then change line no 35

if (function_exists('hash_equals')) { return hash_equals($expected, $actual); }

To

if (function_exists('hash_equals')) { return true; }

for direct access to magento admin with any password and then change password and revert back code changes

This solution work for me

OLD CODE:

 if (function_exists('hash_equals')) {
        return hash_equals($expected, $actual);

NEW CODE:

if (function_exists('hash_equals')) { return true; }

It should work for you

1

But to prevent this from happening, my experience shows admin users passwords, should not be a mix of upper and lowercase charters or include symbols. I know, I know! this goes against all logic with regards to secure passwords, especially those necessary for admin users, but it is like that. So just make them very long, I would suggest in access of 14 characters.

  • I actually experienced this as well... really confusing to me. – surjikal Mar 20 at 20:21
0

due to security reason Magento have introduced account disabled functionality so this is the better way:

1-Create new account by command line:

php bin/magento admin:user:create --admin-user='new-admin' --admin-password='admin@123' --admin-email='abc@xyz.com' --admin-firstname='Firstname' --admin-lastname='Lastname'

2-Now login with the new created username and then change the password of previous user which was causing issue in login.

Thanks,

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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