I would like to allow my PHP script (hosted with apache2) to execute commands with another user account.
I don't want another website hosted on the server to be able to connect to that another user account.
If i add a rule in /etc/sudoers then it will allow anyone of the website to use that user.
The solution i came was to use ssh, with a private key and public key. The PHP script launch a ssh connection with the server it is hosted on, on the desired user account.
Is there another way than my solution with ssh ?