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
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
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="[email protected]" --admin-firstname="Admin" --admin-lastname="Admin"
-
-
-
This works, thank you so much, strange that this happened after a fresh install. Commented Sep 6, 2020 at 1:23
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. Commented May 23, 2017 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. Commented May 23, 2017 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/… Commented May 23, 2017 at 10:08
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
-
Utils class is now present in vendor\laminas\laminas-crypt\src folder in 2.4.5 version. Commented May 25, 2021 at 7:46
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='[email protected]' --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.
-
I actually experienced this as well... really confusing to me.– surjCommented Mar 20, 2019 at 20:21
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" [email protected] --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/
@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
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.
Check number of login failures for a particular user
Magento default max failures count is 6, If you made 6 or more than 6 wrong passwords. Then the user account gets locked.
Max failures count Config path: 'oauth/authentication_lock/max_failures_count'
Solution:
Update the failures_count value to 0 from the database.
SQL Query:
SELECT * FROM `oauth_token_request_log` WHERE `user_name` = '<Your user name>'
UPDATE `oauth_token_request_log` SET `failures_count` = '0' WHERE `oauth_token_request_log`.`log_id` = <Your user Id>;