Ability to limit the POST functions that an account can run.

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.

Related document

 
config/limit.txt · Last modified: 2010/02/28 02:27 by muscardin
 
Except where otherwise noted, content on this wiki is licensed under the following license:CC Attribution-Noncommercial-Share Alike 3.0 Unported
Please visit Automatic Backlinks to start earning free backlinks Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki