Sujet : Re: Simple way for web to execute root shell script.
De : hello (at) *nospam* ezaquarii.com (Chris Narkiewicz)
Groupes : comp.os.linux.misc comp.sys.raspberry-piSuivi-à : comp.os.linux.miscDate : 04. Jun 2025, 08:18:01
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <87ldq8x9ee.fsf@ezaquarii.com>
References : 1
User-Agent : Gnus/5.13 (Gnus v5.13)
The Natural Philosopher <
tnp@invalid.invalid> writes:
I have a shell script that monitors hardware stuff - it needs to run
as root and be called by Apache as user www.
doas /path/to/shell.sh
or sudo.
Things are going to be a bit more complicated if you're in chroot.
A small C utility that wraps exec and provides suid should be ok.
Another way is to call the script form cron and place the output
in some location where apache can get it.
Best regards,
Chris Narkiewicz