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.

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 2025-06-04 08:18 +0100
Organization A noiseless patient Spider
Message-ID <87ldq8x9ee.fsf@ezaquarii.com> (permalink)
References <100pphq$2taj$2@dont-email.me>

Cross-posted to 2 groups.

Followups directed to: comp.os.linux.misc

Show all headers | 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