create new admin user in magento 2

How to Create a New Admin User in Magento 2

by Lily Tran

If you’ve ever faced issues accessing the Magento 2 admin panel, forgetting passwords, or needing to create new admin user in Magento 2, you’re not alone. Managing multiple accounts and credentials can be challenging, especially during Magento development. This guide provides two straightforward methods for creating a new admin user in Magento 2, ensuring you’re never locked out and can manage your store with ease.

Dive in to learn how to set up admin access quickly and securely!

Create New Admin User in Magento 2 Via Admin Panel

Magento 2 configuration allows you to create admin user accounts as many as you want and they will be set in dissimilar access levels if you require. You will find all the information that you need in this detailed tutorial.

  • Step 1: Configure User Information
  • Step 2: Determine User Role

Step 1: Configure User Information

Navigate from the Admin panel, and choose System => Permissions => All Users. Then, click Add New User button.

From here, in the Account Information section, you can create your admin user:

configure admin user information magento

Fill in the required field, note that:

  • User Name: enter the user name for the account. This part is not case-sensitive.
  • Email: the email address must be unique.
  • Password and Password Confirmation: must be similar, contain more than seven characters, and include both letters and numbers.
  • Interface Locale: select the language to be used for the Admin interface if the store has multiple languages.
  • Set to Active in the This Account is field.
  • Current User Identity Verification section: enter your password in Your Password.

Step 2: Determine User Role

In the panel on the left, choose User Role. All existing roles will be listed. Initially, the only role available is Administrator.

Determin user role

From the Assigned column, pick Administrators option then click Save User button to complete.

>>> Master Magento Today – Learn How to Use Magento Step by Step!”

Create New Admin User Magento 2 Via Command Line

Run this command to create new admin user in Magento 2 via CLI

php bin/magento admin:user:create --admin-user='new-admin' --admin-password='!admin123!' --admin-email='bss@bssgroup.vn' --admin-firstname='Bss' --admin-lastname='Test'

Remember to make sure that you have already passed through to the Magento 2 directory before you run this command.

Once the new Magento 2 administrator account has been created, you will see the following success message:

success message when creating admin user via CLI

Created Magento administrator user named new-admin already.

If you forget and want to see all the parameters, you can execute the following command:

php bin/magento admin:user:create –help
Name Value Required?
–admin-firstname Magento administrator user’s first name. Yes
–admin-lastname Magento administrator user’s last name. Yes
–admin-email Magento administrator user’s e-mail address. Yes
–admin-user Magento administrator user name. Yes
–admin-password Magento administrator user password

The password must be at least 7 characters in length and must include at least one alphabetic and at least one numeric character.

We recommend a longer, more complex password. Enclose the entire password string in single quotes. For example, –admin-password=”A0b9%t_3g’.

Yes

Summary

Below is the full guide on Magento 2 create admin user using command line and admin panel. Hope you enjoy this tutorial!

For enhanced security and accountability, BSS Commerce offers the Admin Action Log extension for Magento 2, which tracks and records admin activities in real-time. This extension provides complete visibility over admin actions, helping to prevent unauthorized changes and maintain a secure environment.

Next Reading Suggestions

© 2019 BSS Commerce owned by THANH CONG INTER ., JSC. All Rights Reserved.
Business registration certificate no. 0106064469 issued by Hanoi Department of Planning and Investment on 19 December 2019.
Legal Representative: Mr. Nguyen Quang Trung.