Sujet : Re: Simple way for web to execute root shell script.
De : ldo (at) *nospam* nz.invalid (Lawrence D'Oliveiro)
Groupes : comp.os.linux.misc comp.sys.raspberry-piDate : 24. May 2025, 00:11:39
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <100qvbb$a8a5$4@dont-email.me>
References : 1
User-Agent : Pan/0.162 (Pokrosvk)
On Fri, 23 May 2025 13:26:34 +0100, The Natural Philosopher wrote:
I have a shell script that monitors hardware stuff - it needs to run as
root and be called by Apache as user www.
You could have it running all the time and accepting requests to do things
via a socket interface that you can connect to from a web-based frontend.
Alternatively, it can be running its own mini HTTP server, either directly
exposed on a public port or accessed via a server-side proxy (what they
insist on calling a “reverse proxy”) from Apache/Nginx.
Either way, this would likely be awkward to implement as a shell script. I
would recommend using Python instead.