Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.os.linux.misc > #68329
| From | The Natural Philosopher <tnp@invalid.invalid> |
|---|---|
| Newsgroups | comp.os.linux.misc |
| Subject | Re: Simple way for web to execute root shell script. |
| Date | 2025-06-04 13:12 +0100 |
| Organization | A little, after lunch |
| Message-ID | <101pd75$ojp1$30@dont-email.me> (permalink) |
| References | <100pphq$2taj$2@dont-email.me> <87ldq8x9ee.fsf@ezaquarii.com> |
On 04/06/2025 08:18, Chris Narkiewicz wrote: > 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. > In the end setting a passwordless sudo for the www-data user for that script only, worked and was the first method to do so, so I stopped there. > 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. > I have done that in the past. > Another way is to call the script form cron and place the output > in some location where apache can get it. > I want very fast up to date response when I am on the web site and dont care when I am not, so that inclines towards a real time script. > Best regards, > Chris Narkiewicz -- It is the folly of too many to mistake the echo of a London coffee-house for the voice of the kingdom. Jonathan Swift
Back to comp.os.linux.misc | Previous | Next — Previous in thread | Find similar
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