Add to Favourites Add to Favourites    Print this Article Print this Article

Prevent the creation of any other Admin account on the server

If you only have 1 Admin account and want to make sure no other Admin account is created, you can use the all_pre.sh in order to check the command being run, and block it if it's the creation of an Admin.

Create: /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;


Was this answer helpful?

Also Read