Get started in 5 minutes!

How to change all Magento admin passwords

It is recommended to use at least 10- character, computer generated passwords. In case of a breach, you can assume that all passwords have been intercepted, so they should be changed as soon as possible. The following CLI script may help:

$n98 admin:user:list --format=csv | grep ,active | while read row;
     user=$(echo $row | cut -d, -f2)
     pass=$(tr -cd '[:alnum:]' < /dev/urandom | fold -w10 | head -n1)
     echo "$user -> $pass"
     $n98 admin:user:change-password "$user" $pass >/dev/null

(Use n98-magerun for Magento 1)

This page was last updated at Apr 12th, 2021

Need expert advice?

We are here to help!

Get in touch