Reset admin password via SSH?

Is there a way to reset the Mautic admin password via SSH?

The password reset email doe snot seem to send when mailer is set to use sendGrid so I am permanently locked out of Mautic.

You can try to use MySQL client to reset your password.

BUT: You will have to use the proper function (like md5() or sha()) to hash it, otherwise it will not work.

Another BUT: Please don’t empty your password in the database. The Mautic GUI won’t accept an empty value. :slight_smile:

It seems that Mautic uses bcrypt to hash passwords. You will have to bcrypt your new password and write it to the DB.

I’m in - thank you PeterTL

That’s good to hear!

Would you mind providing a little step-by-step? Maybe the issue happens to someone else - they will be happy to have something at their hands.

One can use the above string to “reset” the password using database (e.g. via PhpMyAdmin).

Put that on the password field in the desired user in the database:

$2a$04$LrQYZmEMFi7GghF0EIv4FOdNv8bFcnlXM9Bta0eb8BWLLlRwcKrUm

Then the user will be able to login using the password “secret” .

Change it after that using the Mautic interface.

5 Likes

Tried reseting the admin password to “$2a$04$LrQYZmEMFi7GghF0EIv4FOdNv8bFcnlXM9Bta0eb8BWLLlRwcKrUm” and I’m still not able to login.

Is there any way with SSH or Mysql access to reset the Admin Password? Thanks!

Bump still locked out… can anyone help!! Thanks!

if you have ssh access to your server you can do the following:

  1. Type this command: sudo mysql -u root
    This will log you into mysql,
  2. then type: show databases;
    This will show you your databases, usually Mautic default install uses DB name mautic,
  3. Type: use mautic; (you can replace the name of the database if you have a different name)
  4. Type: select id, username from users;
    This will give you a list of users
  5. Type: UPDATE users SET password = “a5b253d8484925a3b4fba260768416dfdcbeaed639bb3435c566cbf54721f846903725c7283cf9ab1f090f179d015f46a50b5e798695547eda6e2342db8918a2” where id = 1; make sure you are using the id of the user you want to update.

now you should be able to login with password 12345678.

Hope that works

2 Likes

Your steps for resetting from phpMyAdmin by changing password and using the password: secret just saved me from a meltdown. Thank You!!

This isn’t working for me. Tried resetting password from PHPMyAdmin as well as directly using mysql queries. Tried both passwords suggested here but still can’t login.

Hi and welcome @dinwal

can you take a screenshot of your mysql table of users. I know these are stupid questions, but are you login in with the same user you are changing in the mysql table ?

Another thing to do is maybe go and remove your cache from mautic.
2.x: /var/www/mautic/app/cache. do rm -rf *
3.x:/var/www/mautic/var/cache

Hi guys,
Based on the advice posted by @mikew and others, I have created this blog post with the specific steps required to “reset” you master.admin password.

1 Like

@Yosu_Cadilla this is great, would you be willing to contribute it to the Knowledgebase?