22

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.

11 Answers 11

42

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

1
  • I have did it, but still didn't work Apr 23 at 22:32
19

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"
3
  • 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
  • This works, thank you so much, strange that this happened after a fresh install.
    – Sebastian
    Sep 6 '20 at 1:23
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.

3
  • 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. 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/… 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) .

1
  • To do this you first need to login.
    – bfontaine
    Mar 19 at 15:13
3

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
  • Utils class is now present in vendor\laminas\laminas-crypt\src folder in 2.4.5 version.
    – amitshree
    May 25 at 7:46
2

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,

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.

1
  • I actually experienced this as well... really confusing to me.
    – surj
    Mar 20 '19 at 20:21
0

@user15020 :

Yes, I agree with you not only Magento but its the same issue with mySQL passwords as well. May be those special charcters are meant to be used by programming languages or SQL queries themselves and when its encountered in password strings, it creates issues

0

You can run this command in CLI to unlock admin account:

Unlock admin account

php bin/magento admin:user:unlock YOUR-ADMIN-USER-NAME

Another solution is to create a new admin account in CLI

Create new admin account in CLI

bin/magento admin:user:create --admin-firstname="magentip" --admin-lastname="demo" --admin-email=magentip@gmail.com --admin-user=magentip --admin-password=Qwe@123456

After that, you can login using your new account or use your new account to enable the locked account

Hope this helps

Reference source: https://magentip.com/how-to-fix-you-did-not-sign-in-correctly-or-your-account-is-temporarily-disabled-in-magento-2/

0

There are 3 ways to resolve this error. Find more details here

0

In our case (Magento 2.4) we are missing PHP's sodium extension. Please execute php -m to see if you have sodium installed. Also if you are using docker (like use), make sure that your FPM / CLI container has the extension enabled.

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