Having issues attempting to login to the back end of my M2 store. My login is correct, but when I attempt to login, I get an incorrect CAPTCHA message (even though there was no CAPTCHA on the initial login screen) and then I try again and this time it tells me I'm locked out.

I saw a post similar to this here (Can't log into Magento Admin, "Invalid Captcha" error appears) but this seems to just disable CAPTCHA completely and to me, that's more like a band-aid than a real solution. I certainly don't want to disable the CAPTCHA. I just want to resolve this issue and login successfully instead.

  • There is another way: create a new admin user by using command line. Commented Sep 12, 2019 at 4:07

3 Answers 3


Sometimes you have to unlock an administrator account.

Use this command to unlock the account of an administrator that was locked, typically because of multiple incorrect login attempts:

bin/magento admin:user:unlock {username}

You must specify the administrator’s username. Example:

$ bin/magento admin:user:unlock admin
The user account "admin" has been unlocked

Source : https://devdocs.magento.com/guides/v2.3/install-gde/install/cli/install-cli-subcommands-admin.html


You can update password of your admin login by below command:

php bin/magento admin:user:create --admin-user=abcd [email protected] --admin-firstname=ABCD --admin-lastname=EFGH

Point to be noted: After run above command, it will ask to add password. Please update your password and start using you backend using the password.

You can keep everything same as your last admin user detail like admin user, email, firstname and lastname but just update your password

Ignore adding this --admin-password in above command for security purpose.

You can keep the same old password and enter that once again.

After done with above you can login with your current details.


Firstly, try to unlock the admin user through this command

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

If that doesn't work, try to reset the password for that admin user and try to login

php bin/magento admin:user:create --admin-user={admin_user} --admin-password=admin@123

Lastly, if the above things not work, then create the new admin user

php bin/magento admin:user:create --admin-user=new_admin --admin-password=admin@123 [email protected] --admin-firstname=NewAdmin --admin-lastname=NewAdmin

New Admin Credentials will be username:- new_admin password:- admin@123

  • We should not add "--admin-password" for security reasons
    – Ashish Raj
    Commented Feb 16 at 13:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.