0

I have CentOS 7 and looking for a sollution about a small issue. I want to have a sudo script to be run but only if the system executed a specific command remotely. For example:

I've put my command into a PHP file and I can execute just by curl-ing it. I want the server to notice that the command was executed and execute another command but as sudo and only after the previous command is done.

It this even possible or it's jsut too complicated?

Bert
  • 1,028
  • 1
  • 16
  • 33
  • 2
    This seems like an x/y problem. Tell us what you are trying to solve, not how you want to go about solving it. – user9517 Mar 07 '16 at 17:03
  • We have a few jobs made in cron, and for certain events, they change owners of the corresponting folder. I want to give that folder and all the files back to the original user with a chown. I was thinking about making a cron job for the sudo and chown-ing the folders back from time to time BUT, sometimes the execution of the scripts has to be made more often that in the cron job. In that case, it is frustrating to always check if the ownership was changed and if yes, modify it back. – Bert Mar 09 '16 at 13:17

0 Answers0