Home > Enterprise >  The account sign-in was incorrect or your account is disabled temporarily Magento 2
The account sign-in was incorrect or your account is disabled temporarily Magento 2

Time:06-16

From today when I try to enter the BO of the site it gives me this error:

The account sign-in was incorrect or your account is disabled temporarily. Please wait and try again later.

I have already tried to run this command from ssh:

php bin/magento admin:user:unlock ADMINUSERNAME

and I also changed the columns in the admin_user table:

is_active = 1
failures_num = 0
first_failure = NULL
lock_expires = NULL

and tried to reset my password and to make another admin account, but there is the same error, but it keeps getting that error. How can I solve?

EDIT

I've noticed that this problem shows up on the other sites I have on that server, so I think it's more of a server problem than magento. The sites are on Debian 9.13 with plesk.

CodePudding user response:

Which is the server using? Apache

If yes then check for the Sodium extension is enabled or not in the php.ini file

Sometimes it causes issues while admin login.

CodePudding user response:

This error occurs due to Magento 2’s security system. Magento 2 will temporarily disable accounts that do not meet its password complexity requirements.

By default, in Magento 2, the password that meets security requirements must consist of:

  • Uppercase letters
  • Lowercase letters
  • Numeric
  • Special characters
  • Minimum of 8 characters

The following are the solutions to this issue. Try any of them to see if it works for you.

Solution 1: Unlock the Account

Magento 2 sometimes locks an account for security purposes. In this case, you can unlock it by going to your Magento 2 root folder in the command or terminal and run the below command:

php bin/magento admin:user:unlock <username>

Example: php bin/magento admin:user:unlock admin

Solution2:

Go to localhost/phpmyadmin/ on your browser and select your Magento 2 database.

After that use this syntax to change Magento 2 password using the Mysql command.

SET @salt = MD5(UNIX_TIMESTAMP());
UPDATE admin_user SET `password` = CONCAT(SHA2(CONCAT(@salt, 'NewP@ssword'), 256), ':', @salt, ':1') WHERE username = 'adminusername';

Replace:

  • NewP@ssword with your desired password (must meet Magento 2 security requirement).
  • adminusername with your admin account username.

Example:

SET @salt = MD5(UNIX_TIMESTAMP());
UPDATE admin_user SET `password` = CONCAT(SHA2(CONCAT(@salt, 'Admin@123456'), 256), ':', @salt, ':1') WHERE username = 'admin';

After running the command above, your admin account will be updated with the new password you set in CONCAT(SHA2(CONCAT(@salt, 'NewP@ssword'), 256)

Now you can login to your account normally.

Solution 3: Create a New Admin Account

If none of the above solutions work, create a new admin account. Run the command below via SSH

php bin/magento admin:user:create --admin-user="username" --admin-password="mypassword" --admin-email="[email protected]" --admin-firstname="Admin" --admin-lastname="Admin"

php bin/magento admin:user:create --admin-user="admin" --admin-password="Admin@123456" --admin-email="[email protected]" --admin-firstname="Admin" --admin-lastname="Admin"

Cheers !! :)

Solution 4: Perform the following steps

  • Remove semicolon from the beginning of the line ;extension=sodium from php.ini which enables it.
  • Copy C:\xampp\php\libsodium.dll to C:\xampp\apache\bin\
  • Restart Apache means stop and start Apache.

After all that please run the following command in SSH

Please run following query:

php bin/magento setup:upgrade
php bin/magento setup:static-content:deploy -f
php bin/magento clear:cache

That’s it.

Thank You !!

  • Related