Save up to 30% Learn more

Shopping cart

How to reset a locked Admin account in Magento 2

It’s a common way that hacker can abuse your security wall by attempting many easy-to-guess passwords consecutively. Consequently, your admin backend is locked due to many failed attempts and Magento 2 core will prevent admin users from continuing login.

magento2security

All login actions will be blocked for a certain period of time. If you’re using this Security extension, there will be a warning message sent to your email.

It’s not good news for both parties, unfortunately. To ensure the process of managing your backend timely, you can take advantage of launching some command lines which allows safe admin accounts to be able to log in back to the configuration as soon as possible. In order to have the authority performing Linux command-line operations, you must have the SSH access connecting to your server securely. This step requires permission from the server manager directly so this will be the end game for hackers, they can’t run command lines under your nose obviously.

Move forward to check out how to reset locked admin users, and bookmark them when you need this tutorial in a blink of an eye.

Reset a locked Admin account in Magento 2

Store owner can choose one of listed methods

Solution #1. Unlock in the backend

On the assumption that you’re managing several of admin account but only one or two is locked, this will be the most simple way can be accomplished right in the backend.

Follow System > Locked Users to check all current locked users, choose the specific admin account you want to open the lock.

backend

Solution #2. Using command lines

  • Step 1: Open your Magento 2 dir
  • Step 2: Running command lines.
  • Step 3: Check the result

Step 1: Open your Magento 2 dir

First, open your Magento 2 dir, this is the general format to reset an admin user. Note that you just can unlock one by one account manually.

php bin/magento admin:user:unlock {username}

Step 2: Running command lines.

To unlock a specific admin account, insert the name of that admin into the {username} variable , for example with an admin named sam, type this command line:

php bin/magento admin:user:unlock sam

Step 3: Check the result

A success message will be delivered at the interface if the entered data is valid.

unlocksuccess

  • If there was a mistake in typing the name of the admin, this message will inform:
    Couldn't find the user account "sam"
    

    You should check and retype that command line from Step 1 along with the precise admin name again.

  • In case the account is not locked from the start or it can’t be unlocked, this following message will appear

unlock

To be amazed how protective and supportive your store can be guarded, you can try out to use this Security Solution. It can prevent unwelcomed violate attacks right from the log in steps at the backend, send warning emails timely, archive all login actions and give you a proper checklist which outlines possible harmful factors for your security issues. To prevent email to spam box, enable SMTP here

It comes to the end of tutorial: How to reset a locked Admin account in Magento 2.

PDF Invoice samples for Magento 2

mageplaza pdf invoice

Want to apply these above Invoice templates for your store?

See how

Please leave comments if you have any questions, feedbacks.

Comments for How to reset a locked Admin account in Magento 2

You also may like these Magento 2 Extensions

One Step Checkout

$199
87 reviews

Layered Navigation

$99
49 reviews

SEO

FREE
31 reviews

Gift Card

$199
5 reviews

Reward Points

$149
4 reviews

Affiliate

$149
12 reviews