How To Reset Magento Password

Today I am going to show you that if you forgot your magento admin password then how to reset it.

To reset it there are 2 ways. One you can do it via phpmyadmin. I am not going to discuss it here cause I had a problem with that. I am going to discuss using ftp that worked for me.

Through FTP open the class Mage_Admin_Model_User located at app\code\core\Mage\Admin\Model\User.php
Next find the authenticate() function around line no: 225. Inside the authenticate function, this code is written

$this->loadByUsername($username);

You need to add the line return true; after this i.e

$this->loadByUsername($username);
returntrue;
And that’s it, now you login in admin using any password. Since, we have skipped the code for password checking, login using any password and then change the password in admin from System -> Permission -> Users.