Admin-Ahead Community

Linux => Control Panels => DirectAdmin => Topic started by: vinayakk on January 20, 2014, 02:31:03 pm

Title: Prevent the creation of any other Admin account on the DirectAdmin server
Post by: vinayakk on January 20, 2014, 02:31:03 pm
If you only have 1 Admin account and want to make sure no other Admin account is created, you can use the below script in order to check the command being run, and block it if it's the creation of an Admin.

vim /usr/local/directadmin/scripts/custom/all_pre.sh, and in it, add the code:

#!/bin/sh
if [ "$command" = "/CMD_API_ACCOUNT_ADMIN" ]; then
    echo "Cannot use this command";
    exit 1;
fi
if [ "$command" = "/CMD_ACCOUNT_ADMIN" ]; then
    echo "Cannot use this command";
    exit 1;
fi
exit 0;


 :)