Sujet : Re: Simple way for web to execute root shell script.
De : andrews (at) *nospam* sdf.org (Andrew Smallshaw)
Groupes : comp.os.linux.misc comp.sys.raspberry-piDate : 24. May 2025, 18:35:55
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <slrn10340rq.rbp.andrews@sdf.org>
References : 1
User-Agent : slrn/1.0.3 (Patched for libcanlock3) (NetBSD)
On 2025-05-23, The Natural Philosopher <
tnp@invalid.invalid> wrote:
I have a shell script that monitors hardware stuff - it needs to run as
root and be called by Apache as user www.
>
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?
I have a vague memory of an "shc" package which describes itself
as a shell script compiler. In reality it isn't but its does
package up the script in a directly executable format (i.e. ELF)
and pass it to the shell at runtime. That would allow a SetUID
flag to work. Seems to be listed as a Debian package but I haven't
used it in decades.
-- Andrew Smallshawandrews@sdf.org