The latest versions of Magento Commerce and Magento Open Source v2.4 are now available. More info: https://bit.ly/3h5P28D

Magento 2 Admin User Disabled

Magento 2

After installing Magento 2 and using it several times, and you try to login to your Magento admin, you might get the message “You did not sign in correctly or your account is temporarily disabled.” and it does not allow you to log in with it. This error generally misleads user that whether they are not using correct username or password or there is any other mistake in it.

Magento login form

In this blog, we will show you that how to resolve this sign in problem. In Magento forum, there are many people who are facing or have faced the similar issues. Below are mentioned two cases where such error is prompted or alerted:

  1. Install Magento with the command line, once installation completes try to access admin with set Username and Password. At times, the error is prompted in some cases.
  2. One more reason can be when users try multiple times to do log in with wrong Username and Password, in that case, it is possible that Magento locks that admin user for which multiple attempts are done to access with wrong data.

Solution 1: There is a command available in Magento 2 using which we can unlock admin user if it gets locked. To run that command please follow below instructions:

  • Connect to your server through SSH and go to Magento root directory structure or if you are using window then run command prompt and go to your Magento root directory.
  • Run below command to unlock admin user. You have to replace admin-username with your username which you are using for login into magento admin.

Command : php bin/magento admin:user:unlock admin-username

Magento 2

Once these commands are implemented and executed successfully then automatically the admin user will unlock and you will be able to log in without any hassle or error.

Solution 2: Another option is to create a new user for admin through command line. Also, there is a command available using which user can create separate admin user and access Magento admin with it.

In order to run that command you again would require to follow same steps for SSH or command prompt as mentioned in Solution 1.

Once you are in your root directory of magento project, run below command to create new admin user.

Command: php bin/magento admin:user:create –admin-user=”admin2″ –admin-password=”Admin123″ –admin-email=”admin@gmail.com” –admin-firstname=”Admin2″ –admin-lastname=”Admin2″

Magento 2

This command has several parameters where we need to provide our values to set, here are details for all of them-

–admin-user= “admin2”: It contains username which we need to set in for that new admin user.
–admin-password= “Admin123”: It contains password for this new admin user.
–admin-email= “admin@gmail.com”: We need to set email address of new admin user.
–admin-firstname= “Admin2”: It contains first name of new admin user.
–admin-lastname= “Admin2”: It contains last name of new admin user.

All these values are compulsory to set while creating new admin user using command line, because those are required fields on creating new admin user.
With that we also need to take care of default password validations where it must validate following conditions:-

  • It must contains at least 7 characters.
  • Password should be alphanumeric.

After this command runs successfully, our new admin user will be created into our magento website and you will be able to log in using that user.

Thus, with following either of two solutions we can easily come over the error related to admin user temporary disabled. You will now be able to login with that new user immediately. Check out our more services on Magento development here.

Tell us about your project

Hire dedicated Magento developer from the vast and talented pool of resources.