Log in to your server with SSH. You can either use Putty or OS Terminal to connect.
- Run ssh your-username@hostname/IP
- Enter your password when prompted
Navigate to your Magento installation, but replace the bracketed placeholders accordingly:
Retrieve the admin user’s information from the database using the below command, but make the following adjustments:
Replace [db_user] with your database user.
Replace [db_name] with your database name.
Within username=”[admin]'”, replace [admin] with the username requiring the reset. You will be prompted to for the database password before continuing.
echo “select email,firstname,lastname from admin_user where username='[admin]'” | mysql -u [db_user] [db_name] -p
To reset the password of a user, execute the following, but replace the bracketed placeholders between the quotation marks with the current user’s information:
php bin/magento admin:user:create –admin-user=”admin” –admin-password=”newpassword” –admin-email=”firstname.lastname@example.org” –admin-firstname=”Test” –admin-lastname=”Test”
- hit enter and the password will be updated.