To optimize management activities, Magento admin definitely needs to create Magento admin user at different access levels. Various levels of responsibility and permissions make sure that the admins in your web store are put in the right positions. This function from Magento, on the one hand, guarantees that everyone can access the area they are in charge of. On the other hand, you can prevent other admins from reaching unauthorized sections of your stores.
For example, a marketer is allowed to open the Catalog, Marketing and Content in the admin panel, but they can not see the other sections. Considering this scenario, this blog will reveal how to create Magento 2 admin user accounts with a suitable level of access.
Table of contents
Create New User Roles in Magento 2
Before elaborating a new admin user, we need to create new user roles first. In other words, this is to create varying types of administrators for your store. Magento 2 backend has provided you with a default role called “admin”, but it’s not truly suitable for everyone. We need to create a user role (admin type) that exactly meets our demand.
Navigate to System > Permissions > User Roles
Click Add New Role
Then, you will be redirected to a page that requires you to fill out the following information:
In the section Role Info:
Role Name: Name your desired admin type.
Current User Identity Verification: To ensure system security, the current user must enter their password in this field. It helps prove that the person who is making changes and the account owner is exactly the same one.
Next, span Role Resources:
– Choose All if you want to grant all admin rights to this new role.
– Choose Custom to customize specific rights for this new role.
Resources: Tick the resources that you want to authorize to this role.
Click Save Role to finish the configuration.
So we have gone through the process of creating a new role, and bear in mind that you can also create as many roles as you want. Now we’ll move on to create Magento 2 admin user accounts.
How to Configure Magento 2 Admin Session Lifetime
How to Disable 2FA in Magento 2.4 Using Command Lines
Magento 2 Two-Factor Authentication: A Good Way to Protect Magento Store
Create Magento Admin User Using the Admin Panel
Follow the path System > Permissions > All Users
The backend will show you a grid of existing users including their ID, first name, last name, user name, email role and status. Our goal is to create a new user account owning all of that information. So click Add New User.
There are 3 tabs for you to complete:
1. Configure User Information
- User Name: Enter a unique user name (that has not existed before). The user name will be used in the Magento admin dashboard and to sign in.
- First Name: Enter the new user’s first name
- Last Name: Enter the new user’s last name
- Email: Fill in this field the email address which is associated with the new account. It will help in case the user forgets his password.
- Password: Set a password for this account. The password must be at least seven characters long and includes both letters and numbers.
- Password Confirmation: Enter that new password one more time for the accuracy checking purpose.
- Interface Locale: Choose your admin account language if your website owns multiple store views.
- This account is: Choose Active to activate the new account.
- Expiration Date: Hit the calendar icon and choose the time when this account is terminated.
Current User Identity Verification: As mentioned above, to ensure system security, the current user must enter their password in this field. It helps prove that the person making changes is also the account owner.
2. Assign User Role
Next, span User Role
It shows a grid of roles in your Magento store, tick any role you want to assign in the column Assign. If this is the first time you create a new role and new user, you will see only admin role as Magento default value.
3. Verify a 2FA Provider (Available from Magento 2.4)
In terms of Magento 2 two-factor authentication, we have provided detailed instructions on how to use it. This multi-layered protection for Magento admin comprises 2 requiring factors whenever an admin login to the store. They are a password and a 6-digit code verified by a third-party device.
The default 2FA provider in Magento is Google Authenticator. If you want to change the provider, you need to set up in another section.
Click Save User and check out the result!
Create Magento Admin User by Command Execution
Creating a new admin user account using command line is the privilege of the administrator who has full permissions. If you want to set up a role for this new user, you must do it by signing in to the admin panel.
Magento offers its admin 2 ways to create new users by command execution:
Go to the Magento 2 root folder via SSH and run the command line with full required arguments:
php bin/magento admin:user:create --admin-user=ADMIN-USER --admin-password=ADMIN-PASSWORD --admin-email=ADMIN-EMAIL --admin-firstname=ADMIN-FIRSTNAME --admin-lastname=ADMIN-LASTNAME
Below is the explanation for the arguments of the command line:
- ADMIN-USER: Enter a unique user name (that has not existed before). The user name will be used in the Magento admin dashboard and to sign in.
- ADMIN-PASSWORD: Set a password for this account. The password must be at least seven characters long and includes both letters and numbers.
- ADMIN-EMAIL: Fill the email address which is associated with the new account. It will help in case the user forgets his password.
- ADMIN-FIRSTNAME: Enter the new user’s first name
- ADMIN-LASTNAME: Enter the new user’s last name
For more details, please refer to Magento DevDocs.
Go to the Magento 2 root folder via SSH and run the command line:
php bin/magento admin:user:create
Next, the CLI will require you to fill user name, first name, last name, email address and password.
Finally, don’t forget to flush cache and check the result.
Deciding how open or closed you want your system to be with an admin user in Magento 2 has never been this easy. Hopefully, it helps you speed up the management process of Magento store. Other than that Magezon also offers store owners a wide range of Magento 2 robust extensions. If you’re looking for extensions to optimize your store, visit Magezon!
Optimize Your Magento Store With Powerful Extensions
Looking for fast, efficient and well-coded extensions to build or optimize your Magento stores for sales boosting? Then visit Magezon website and grab necessary add-ons for yours today!