Skip to content

Magento 2 add a user via command line cli

Magento does not allow resetting password of an existing user using the command prompt CLI.

But it allows creating new admin users via CLI.

Login to the command line and change directory to your magento 2 root directory.

e.g. cd  /var/www/magento2

Enter the below command and press enter.

php bin/magento admin:user:create

The CLI will prompt for username, password, email address, first name and last name for the user being created.