Step 1 : Login into your Magento 2 Server with SSH:
ssh your SSH username@your server IP
Step 2 : Now after the SSH connect lets navigate to the Magento installation directory in my case /var/www/html/
Step 3 : Execute the following below command to create a new administrator with username “ewaadmin” and password “admin@981”
php bin/magento admin:user:create --admin-user='ewaadmin' --admin-password='admin@981' --admin-email='expertwebadvisor@gmail.com' --admin-firstname='EWA' --admin-lastname='Admin'
As soon as you hit the enter button the new Magento2 administrator account has been created, you will see the success message like this : Created Magento administrator user named ewaadmin
In the command we have different parameter used see theses parameter below:
--admin-user : Magento administrator user name --admin-password : Magento administrator user password --admin-email : Magento administrator user's e-mail address --admin-firstname : Magento administrator user's first name --admin-lastname : Magento administrator user's last name
To see all these options through the SSH you can run the “help” command like below:
php bin/magento admin:user:create --help
I hope this helps and you can create the administrator account easily in Magento 2. Stay tuned for the Magento 2 latest tutorial and updates, Hope you enjoyed reading, if you need the professional Magento 2 Development / PHP we can help you, just Click on the Link and send me your requirements.