corbeeresearch Posted November 8, 2010 Share Posted November 8, 2010 Hi, is it possible to make a php script only executable by cpanel's cron job and not by anyone else. I was thinking chmod, but what's the correct chmod to make it only executable by server and not just by anyone, or does anyone know how to prevent a visitor(hacker) from running a script that is designed to be only used by cron? Thanks Quote Link to comment Share on other sites More sharing options...
thehippy Posted November 8, 2010 Share Posted November 8, 2010 Basic Unix permissions come in a three digit octet sequence (ex. 755). Where the first digit relates to the owner permissions, the second digit to the group permissions and the third to everyone else. Pretty good explanation here. The situation is dependant on your group memberships and cron's group memberships so I'll leave you with a non permission based solution. $_ENV will contain some different variables from a command line execution versus a website/apache execution. I'd just detect one or more of those variables and execute my script or log/exit otherwise. I'll leave it up to you to find those variables. Quote Link to comment Share on other sites More sharing options...
corbeeresearch Posted November 9, 2010 Author Share Posted November 9, 2010 Thanks Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.