Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.os.linux.misc > #68302

Re: Simple way for web to execute root shell script.

Path csiph.com!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!eternal-september.org!.POSTED!not-for-mail
From Chris Narkiewicz <hello@ezaquarii.com>
Newsgroups comp.os.linux.misc, comp.sys.raspberry-pi
Subject Re: Simple way for web to execute root shell script.
Followup-To comp.os.linux.misc
Date Wed, 04 Jun 2025 08:18:01 +0100
Organization A noiseless patient Spider
Lines 16
Message-ID <87ldq8x9ee.fsf@ezaquarii.com> (permalink)
References <100pphq$2taj$2@dont-email.me>
MIME-Version 1.0
Content-Type text/plain
Injection-Date Wed, 04 Jun 2025 09:18:26 +0200 (CEST)
Injection-Info dont-email.me; posting-host="0e987ce2737a28d05c269f58cbc0c248"; logging-data="731586"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18BJTtoPyR3xv7sAIBjQQoYOmF+6phefm8="
User-Agent Gnus/5.13 (Gnus v5.13)
Cancel-Lock sha1:CGMrmMunO2/8l5ERtMqtOAAV6VI= sha1:5yt1nFSMby11/skDqzjGsZMYqr8=
X-Motto Unix - live free() or die()
Xref csiph.com comp.os.linux.misc:68302 comp.sys.raspberry-pi:36734

Cross-posted to 2 groups.

Followups directed to: comp.os.linux.misc

Show key headers only | View raw


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

Back to comp.os.linux.misc | Previous | NextNext in thread | Find similar


Thread

Re: Simple way for web to execute root shell script. Chris Narkiewicz <hello@ezaquarii.com> - 2025-06-04 08:18 +0100
  Re: Simple way for web to execute root shell script. The Natural Philosopher <tnp@invalid.invalid> - 2025-06-04 13:12 +0100

csiph-web