As a Plesk administrator, you can use the Mass Password Reset script to reset passwords across all accounts or specific account groups with a single command. This script outputs the new account names and passwords directly in the command line and generates a new_plesk_passwords.csv
file in the script's directory for reference.
Downloading the Mass Password Reset Script
To begin, download the script from the Plesk repository:
curl -LO https://raw.githubusercontent.com/plesk/kb-scripts/master/plesk-password-changer/plesk-password-changer.php
Available Commands and Options
Below is a list of commands and options you can use with the Mass Password Reset script. Each option lets you target specific account types for password reset, as needed:
Action | Command | Description |
---|---|---|
Reset passwords for all Plesk accounts | /usr/local/psa/bin/sw-engine-pleskrun plesk-password-changer.php `cat /etc/psa/.psa.shadow` |
Resets passwords for all accounts in Plesk |
Reset passwords for the admin user | /usr/local/psa/bin/sw-engine-pleskrun plesk-password-changer.php `cat /etc/psa/.psa.shadow` --admin |
Resets only the admin user password |
Reset passwords for additional administrators | /usr/local/psa/bin/sw-engine-pleskrun plesk-password-changer.php `cat /etc/psa/.psa.shadow` --additionaladmins |
Resets passwords for all additional administrator accounts |
Close all active Plesk sessions | /usr/local/psa/bin/sw-engine-pleskrun plesk-password-changer.php `cat /etc/psa/.psa.shadow` --clean-up-sessions |
Closes all active Plesk sessions |
Reset passwords for resellers | /usr/local/psa/bin/sw-engine-pleskrun plesk-password-changer.php `cat /etc/psa/.psa.shadow` --resellers |
Resets passwords for all reseller accounts |
Reset passwords for clients | /usr/local/psa/bin/sw-engine-pleskrun plesk-password-changer.php `cat /etc/psa/.psa.shadow` --clients |
Resets passwords for all client accounts |
Reset passwords for FTP accounts | /usr/local/psa/bin/sw-engine-pleskrun plesk-password-changer.php `cat /etc/psa/.psa.shadow` --domains |
Resets passwords for main FTP accounts of all subscriptions |
Reset passwords for all database users | /usr/local/psa/bin/sw-engine-pleskrun plesk-password-changer.php `cat /etc/psa/.psa.shadow` --dbusers |
Resets passwords for database users across Plesk |
Example Commands
Below are examples of how to use the script to reset passwords in specific scenarios:
Example 1: Set a Specific Password for the Admin User and Reset Passwords for All Other Accounts
/usr/local/psa/bin/sw-engine-pleskrun plesk-password-changer.php `cat /etc/psa/.psa.shadow` '*****'
Example 2: Reset Passwords for Plesk Users and Email Accounts Only
/usr/local/psa/bin/sw-engine-pleskrun plesk-password-changer.php `cat /etc/psa/.psa.shadow` --users --mailaccounts
Output and Log File
Once executed, the script generates the following outputs:
- Command Line Output: Displays the account names and their new passwords.
- CSV File: Creates a
new_plesk_passwords.csv
file with the new passwords, saved in the same directory as the script for easy access and record-keeping.
Disclaimer
Ensure to secure the new_plesk_passwords.csv
file as it contains sensitive information. Verify account access after running the script to confirm successful password resets.