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.
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.
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.
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:
now you should be able to login with password 12345678.
Hope that works
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.
@Yosu_Cadilla this is great, would you be willing to contribute it to the Knowledgebase?
Found a super easy solution if you do not have access to terminal but PHP Admin through Plesk Gui or similar. So if you are in Plesk/Cpanel for example, what you are going to do is click on the PHP Admin of your Database. Once you are in there follow these steps
PS I should also state that this worked for me with Mautic Version 4.4.12 through a web install not docker, save your old password before you try!
I implemented a command in custom plugin that enables you to reset password.
Plugin is for M5.
Hello
You can reset any mautic password via the ssh shell using the console commands with just one line.
Show a list of mautic users:
php bin/console doctrine:query:sql "select email from users;"
Reset a mautic user via email and set a random generated password:
(Copy and paste this line into the ssh shell but changing the email address of course)
EMAIL="admin@localhost.local" CLIENTPWD=$(openssl rand -hex 8) MAUTIC_ENCODED_PWD=$(php bin/console security:encode-password --no-interaction --ansi "$CLIENTPWD"|grep 'Encoded password'|awk '{ print $5; }') && php bin/console doctrine:query:sql "UPDATE users SET password='$MAUTIC_ENCODED_PWD' where email = '$EMAIL'" && echo "'$EMAIL' got new Password: $CLIENTPWD"
Output:
(the last line contains the new Password for the email address)
Would be great to have some best practices on the docs / KB if anyone would like to contribute!
I adapted @sfahrenkrog1 command for Mautic 5
EMAIL="admin@localhost.local" CLIENTPWD=$(openssl rand -hex 8) MAUTIC_ENCODED_PWD=$(php bin/console security:hash-password --no-interaction --ansi "$CLIENTPWD"|grep 'Password hash'|awk '{ print $3; }') && php bin/console doctrine:query:sql "UPDATE users SET password='$MAUTIC_ENCODED_PWD' where email = '$EMAIL'" && echo "'$EMAIL' got new Password: $CLIENTPWD"
HTH
Thanks @sfahrenkrog1 !!