V
V
Vi2017-05-25 07:13:36
linux
Vi, 2017-05-25 07:13:36

Oh, PHP-FPM - well, run my script as root?

In short, nginx + php-fpm , I call the script through the browser, it draws two buttons for me. By pressing any of them, a python script is launched on the server, but it needs root rights to work.
How to safely and beautifully implement this?
what I tried:
- sudoers (I didn’t mess around a lot, but on the first try I didn’t manage to run my pathetic script, I don’t know how to write it there correctly)
- I read about setuid setguid , but it doesn’t plow
- well, and options to give the php-fpm user root I didn’t even consider it because it’s dangerous
O Kind and smart people, help me solve this as safely and beautifully as possible (beautiful is more important than safe)

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question