How to create admin user via terminal in Magento 2
In this article we will learn how to create admin user via terminal in Magento, in a practical and easy way for you to run your tests.

Hey you programmer, okay? Let’s learn how to create an administrative user via the terminal in Magento 2!
Anyone who worked with Magento 1 knows that it was a lot of work and boring to create the user via the administrative area
And in Magento 2 this has been solved, we can create administrative users via the terminal, check out the command:
php bin/magento admin:user:create
Given this command, we need to answer some questions that make reference to user data
Here they are:
- Admin user: username to login;
- Admin password: password the user will use to login;
- Admin email: email the user will use to receive emails such as recovering password;
- Admin first name: user’s first name;
- Admin last name: user’s last name;
After that, the user will be created and a success message should be displayed with the following message:
Created Magento administrator user named username
The username is the name you entered earlier
Now just test it by logging into your project’s administrative area.
Remember: this user was created via the command line,he is already unlocked and can authenticate normally
Which is handy as we don’t need to do anything from the admin page
Conclusion
In this article we learned how easy it is to create an admin user from the terminal in Magento 2
We simply type the command:
php bin/magento admin:user:create
And Magento will guide us through the process
Want to learn more about Magento? Click here!