Script to change all passwords on a DA server: da_changepass

Sempiterna

Verified User
Joined
Jun 21, 2014
Messages
10
Location
The Netherlands
Hi, i am not sure if this is the correct forum for this. if not, please move it :)

I have created a small php commandline script to change passwords for DA users, or e-mail addresses, or FTP accounts. This script can reset passwords for either all (DA/custom e-mail,/custom ftp) accounts, or a single domain, or a single (DA/e-mail/ftp) user, and it can also mail the changed password to the affected DA user, as well as mail a summary of all changes to an e-mail address provided in the script. It can be run by an admin to reset passwords server wide, or by a reseller (with shell access) to reset passwords for users that are in his/her realm.

This is useful in cases where an exploit is found, and all passwords (of everything) serverwide need to be changed, or an employee who has all the passwords has left, or a client's computer is compromised, and he/she wants all passwords of everything related to his/her domains changed.

The script can connect to a DirectAdmin server remotely, which is useful if you have more than one server to manage.

It can be downloaded from:

https://github.com/sempiterna/DA-ChangePass

A more extensive overview on what it does can be read at:

http://directadminguru.com/changing-some-or-all-directadmin-related-account-passwords/

Be sure to review and (where needed) update the parameters inside the script. Every parameter has a description to explain what it is for.

Script usage:

Code:
   [B]Change the password of one user:[/B]
      ./da_changepass.php --user <username> <optional password>
      If no password is given, a random one will be generated

   [B]Change the passwords for all users except te admin user:[/B]
      ./da_changepass.php --alluser

   [B]Change the e-mail password for all e-mail accounts on the server:[/B]
      ./da_changepass.php --allmail

   [B]Change all e-mail passwords for a specific domain:[/B]
      ./da_changepass.php --mail <domainname>

   [B]Change the e-mail password for a specific e-mail address:[/B]
      ./da_changepass.php --mail <e-mail address> <optional password>
      If no password is given, a random one will be generated

   [B]Change the ftp account password for all ftp accounts on the server:[/B]
      ./da_changepass.php --allftp

   [B]Change all ftp account passwords for a specific domain:[/B]
      ./da_changepass.php --ftp <domainname>

   [B]Change the ftp account password for a specific account:[/B]
      ./da_changepass.php --ftp <ftpuser@domain> <optional password>
      If no password is given, a random one will be generated

   [B]Display a list of ftp or e-mail accounts:[/B]
      ./da_changepass.php --list <ftp | mail> <optional domain>

   [B]Send a test e-mail:[/B]
      ./da_changepass.php --mailtest
I have tested this script extensively, but nevertheless, it comes without any warranty.
 

BBM

Verified User
Joined
Jun 8, 2013
Messages
349
Location
Dutch Mountains
Thanks for sharing this.
Could be handy someday perhaps in case of serverbreach when a backup can't be restored anymore orso.
(hopefully not ofcourse)
 
Top