Prevent Users from changing their own DirectAdmin password


Enter Your Query:
Use '%' for wildcards and quotes for "exact phrases"


Top Level » DirectAdmin » Custom Scripting

Prevent Users from changing their own DirectAdmin passwordLast Modified: May 3, 2017, 6:40 pm
There are some cases where you do not want to allow Users to change their passwords, but still allow the passwords to be changed via their creator.  I believe WHMCS might be one of these cases, where they'd change their passwords from there.

In DA there are a few ways you could block their access to CMD_PASSWD, but assuming you have 1.51.4+, the simplest would be to create the custom script:

/usr/local/directadmin/scripts/custom/user_password_change_pre.sh

with code

#!/bin/sh
if [ "$called_by_self" = "1" ]; then
       echo "You cannot change your own password.";
       exit 1;
fi
exit 0;

and chmod the script to 755.

© 2018 JBMC Software, Suite 173  3-11 Bellerose Drive, St Albert, AB  T8N 1P7  Canada.  Mon-Fri 9AM-5PM MST