Question

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.

Was it helpful?

Solution

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

OTHER TIPS

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"

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.

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) .

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

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,

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top