Hello Magento Friends,

Today I will discuss How to Unlock Admin User in Magento 2.

Your Magento 2 store may have two or more admin users. Admin users are created to assign different tasks to the members of the team. Learn How to Create New Admin User in Magento 2.

You are trying to login into the admin panel but are unable to log in and receive the below error.

login error

This is because you have been locked by the Magneto system due to some problem or incorrect details.

For safety reasons, the Magento admin user is automatically locked after six login failures. The locked users are seen on the locked user grid of the admin form. Another admin user with administrator permissions can unlock the locked admin user.

After the failure of 6 attempts, the user is locked by the Magento system. So here I will be explaining how to unlock admin users in Magento 2.

How to Unlock Admin User in Magento 2?

You can unlock the admin user in Magento 2 in two ways – Command line and Admin Panel. Here I will explain both ways in detail.

Method 1: Command Line

If you want to unlock the Admin user using Command Line then use the below command

Unlock Admin User Syntax :

Unlock Admin User Example :

Unlock Admin User Output :

—> If the admin user is successfully unlocked, you can see the output like this:

The user account “magecomp” has been unlocked

—> If the admin account is either not locked or if there was a problem, the output will be like this:

The user account “magecomp” was not locked or could not be unlocked.

—> If the admin account doesn’t exist, you can see the output like this:

Couldn’t find the user account “magecomp”.

Unlock Admin User Help :

If you want help regarding how to unlock admin users using the command line then use the below command.

Method 2: Magento 2 Admin Panel

Step 1: From the Admin Panel, move to System -> Permissions -> Locked Users

locked user grid

Step 2: You will get a list of locked users if any. Select the user you want to unlock by clicking on the checkbox. Select actions as Unlock and then click the Submit button.

unlock user


This was all about unlocking admin users in Magento 2. You can also get all admin user data in observer in Magento 2. You can even prevent any unusual changes from the backend by an admin user with the help of Admin Actions Log Extension for Magento 2.

If you are still unable to unlock the admin user, reach out to me via the comment section and I will help you solve the problem you are facing. Share the solution with your friends who are dealing with the issue of locked admin users.

Happy Reading!

Click to rate this post!
[Total: 3 Average: 5]