Mautic Community Forums

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.

1 Like

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!!