Magento 2 How to Unlock Admin User in Magento 2
Vinh Jacker | 12-18-2024
In Magento 2, the admin user account can get locked after multiple failed logins or security settings. That’s why you can be hindered when accessing and managing your store immediately. Unlocking the admin user is so important to maintain smooth operations and ensure timely updates or changes. In this article, we’ll provide you with two methods for unlocking an admin account in Magento 2 via the Command Line and the Admin Panel.
How to Unlock Admin User via Command Line
Go to Magento admin root folder and show usage:
php bin/magento admin:user:unlock --help
Usage:
admin:user:unlock <username>
Arguments:
username The admin username to unlock
Options:
-h, --help Display this help message
-q, --quiet Do not output any message
-V, --version Display this application version
--ansi Force ANSI output
--no-ansi Disable ANSI output
-n, --no-interaction Do not ask any interactive question
-v|vv|vvv, --verbose Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
Help:
This command unlocks an admin account by its username.
To unlock:
bin/magento admin:user:unlock username
Syntax to Unlock Admin user
php bin/magento admin:user:unlock username
Let unlock a admin account: mageplaza with the following information
Type in the command line:
php bin/magento admin:user:unlock mageplaza
Output:
The user account "mageplaza" has been unlocked
Note
If the admin user was not locked, you may get this message:
The user account "mageplaza" was not locked or could not be unlocked
Now to go to admin login page, and fill the above information
and I’m in now, see this screenshot
How to Unlock Admin User via The Admin Panel
#1. From the Admin Panel, go to System > Permissions > Locked Users
.
#2. The next step is to choose the Unlock
action
#3. Then, you need to enter the username you want to unlock.
#4. Click
Submit
to unlock the user
Conclusion
In this article, we have provided 2 effective methods to unlock the admin user via the command line and the admin panel. We hope that this guide is helpful and you can follow it easily. If you have any questions, don’t forget to let us know. We’ll get back to you as soon as possible. Thanks for reading.