How to reset Magento 2 admin passwords

How to reset Magento 2 admin passwords

Overview
This guide demonstrates how to reset the Magento 2 admin password through both the web interface and the command line interface (CLI).

Method

Method 1 uses the Magento 2 web interface and is preferable to Method 2, which requires both SSH access and familiarity with the command line interface (CLI). For information about how to enable SSH access as a Nexcess client, see this article.

Method 1: Web interface

  1. Navigate to your admin login page.

  2. Click Forgot your Password? 
    Screenshot - 5_16_2016 , 10_42_34 AM.png

  1. In the Email address field, enter your email address, then click Retrieve Password.

  1. If the email address is correct, you will receive an email containing a link to confirm the password reset. Click this link to launch the password reset page.

  2. In the New Password and Confirm New Password fields, enter the same password, then click Reset Password.

  1. Enter your new credentials to log in to the Magento 2 admin panel.

Method 2: CLI

You must have SSH access to your server in order to use this method. If you do not have SSH access, see How to enable SSH access for details.

  1. Log in to your server with SSH.

  2. Navigate to your Magento installation, but replace the angled brackets (<>) and everything between them with the indicated information:

    cd /home/[demo]/<demosite.com>/html/

  1. Retrieve the admin user’s information from the database using the below command, but make the following adjustments:

    1. Replace <db_user> with your database user.

    2. Replace <db_name> with your database name.

    3. 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

  1. 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="<test@example.com>"  --admin-firstname="<Test>" --admin-lastname="<Test>"

For 24-hour assistance any day of the year, contact our Support Team by email or through the Client Portal.

Article Rating (No Votes)
Rate this article
  • Icon PDFExport to PDF
  • Icon MS-WordExport to MS Word
 
Attachments Attachments
There are no attachments for this article.
Related Articles RSS Feed
How to write redirect (301) rules for Magento 2
Added on Mon, Dec 31, 2018
How to set the return path email in Magento 2
Added on Mon, Dec 31, 2018
How to flush your Magento cache
Added on Tue, Jan 29, 2019
How to enable Varnish for Magento 2 on Nexcess Cloud
Added on Thu, Jun 6, 2019
How to create Magento 2 dev sites
Added on Mon, Dec 31, 2018
How to disable maintenance mode in Magento
Added on Tue, Jan 29, 2019
How to configure Magento 2 to use Elasticsearch
Added on Fri, Feb 22, 2019
What is Magento?
Added on Tue, Jan 29, 2019
How to configure Magento 2 cron jobs
Added on Tue, Mar 27, 2018
How to configure Magento 2 storefronts
Added on Mon, Dec 31, 2018