Get your server issues fixed by our experts for a price starting at just 25 USD/Hour. Click here to register and open a ticket with us now!

Author Topic: Prevent the creation of any other Admin account on the DirectAdmin server  (Read 12567 times)

0 Members and 1 Guest are viewing this topic.

vinayakk

  • Guest
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;


 :)