If you want to create an account with limited functionality, the /usr/local/directadmin/scripts/custom/all_pre.sh script can be created for that task. A common reason is for API related command from a remote server. In this example, we'll show how to limit the command the “admin2” account can run, to only be allowed the basic dns api related functions for the multiserer dns:
#!/bin/sh
if [ "$username" = "admin2" ]; then
if [ "$command" = "/CMD_API_DNS_ADMIN" ]; then
exit 0;
fi
if [ "$command" = "/CMD_API_LOGIN_TEST" ]; then
exit 0;
fi
if [ "$command" = "/CMD_API_ADMIN" ]; then
exit 0;
fi
exit 1;
fi
exit 0;
Save that to your all_pre.sh script. The same idea can be applies to any command that an account can run. Note that this only applies to POST functions. All “GET” functions are not hindered by this script.
Remember to chmod the all_pre.sh to 755.