Liste des Groupes | Revenir à col misc |
The Natural Philosopher <tnp@invalid.invalid> wrote:I did in fact go that way...On 23/05/2025 15:08, Lew Pitcher wrote:If it's a shell script then it won't run as root even if it is suidOn Fri, 23 May 2025 13:26:34 +0100, The Natural Philosopher wrote:cant one execute it direct from apache?
>I have a shell script that monitors hardware stuff - it needs to run as>
root and be called by Apache as user www.
As you probably already know, the system won't run shell scripts as setuid,
even if the setuid bit is set. So, the direct route is out.
>>>
Bookworm linux on a Pi4.
>
Its all inside a domestic firewall so security is not a huge issue.
What is the quickest and simplest solution to this?
My gut reaction would be to have the webserver use sudo(1) (with suitable
limitations set in the /etc/sudoers file) to run the script via a system(3)
call.
>
root.
I'd go the sudo way, but I'm not neutral about that¹.
Greetings--
Marc
¹ I maintain sudo in Debian
Les messages affichés proviennent d'usenet.