The Magento 2 admin cannot be accessed after it has been installed and used several times. You may get a message saying “You did not sign in correctly or your account has been temporarily disabled.” and it will not allow you to access the admin. Generally, this error leads the user to believe that they are not using the correct username or password or something else is wrong.
So we will not check how to unlock – Admin user
We will show you how to fix this issue in this blog. Magento forum is full of people with similar issues. Below are two examples of when such an error is prompted or alerted:
- After installing Magento with the command line, attempt to access the admin area with your set username and password. In some cases, an error message may appear.
- Another possible reason is when users repeatedly try to log in with wrong Username and Password; in this case, Magento may lock the admin user for which multiple attempts have been made to log in with wrong information.
Solution 1: Magento 2 has a command that allows us to unlock an admin user if it is locked. Follow the instructions below to run that command:
- You can connect to your server through SSH and navigate to the Magento root directory structure, or if you are using a window, run command prompt and navigate to the Magento root directory.
- To unlock admin user, run the following command. Replace admin-username with the username you use to log into the Magento admin.
Run Below Command
php bin/magento admin:user:unlock admin
Replace admin by username which you want to unlock
Upon successfully implementing and executing these commands, the admin user will automatically unlock and you will be able to log in without any hassle or errors.
A second option is to create a new user for admin via the command line. Additionally, there is a command that allows users to create separate admin accounts and access Magento admin using them.
In order to run that command, you would need to follow the same steps as in Solution 1 for SSH or command prompt.
To create a new admin user, run the following command in the root directory of your Magento project.
Run Below Command
php bin/magento admin:user:create –admin-user="admin" –admin-password="admin@123" –admin-email="firstname.lastname@example.org" –admin-firstname="Frist name" –admin-lastname="last name"
Our new admin user will be created on our Magento website after this command runs properly, and you will be able to log in using that user.
As a result, by implementing any of the two methods, we can simply resolve the problem relating to the admin user being temporarily disabled. You’ll be able to log in as that new user right away. Check out our other Magento development services here.
I am developer , for more info do read my blogs.