How to reset the Admin password in Magento2 using the Command Line Interface Tool

Introduction

n98-magerun is a command-line interface tool for Magento that allows developers, administrators, and DevOps users to perform maintenance tasks, development work, and configuration management. It provides commands for system information, database maintenance, cron jobs, integration APIs, and more

Prerequisite

  1. A sudo privileged user to SSH the server

Implementation

Step 1: Download the CLI tool at the root of your Magento project

$wget https://files.magerun.net/n98-magerun2.phar

Step 2: Set executable permissions 

$ chmod +x ./n98-magerun2.phar

Step 3: Install the CLI tool

$ php n98-magerun2.phar

Step 4: List the Admin user associated with the Magento2 panel

$ php n98-magerun2.phar admin:user:list

Step 5: Reset the password by updating the admin user and new password

$ php n98-magerun2.phar admin:user:change-password

meenakshi k

Meenakshi is a DevOps Engineer with 4 years of experience in AWS, Linux, server administration, server maintenance, Docker, Kubernetes, CI/CD, monitoring, security, HIPAA compliance, and technical customer support. Areas of expertise include cloud operations, deployment management, system reliability, secure server environments, and technical issue resolution, with a focus on evolving DevOps practices and industry trends.

Leave a Reply

Scroll to Top