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

Liste des GroupesRevenir à cs raspberry-pi 
Sujet : Re: Simple way for web to execute root shell script.
De : jpstewart (at) *nospam* personalprojects.net (John-Paul Stewart)
Groupes : comp.os.linux.misc comp.sys.raspberry-pi
Date : 23. May 2025, 15:14:42
Autres entêtes
Message-ID : <m9be6iFj8hrU1@mid.individual.net>
References : 1
User-Agent : Mozilla Thunderbird
On 2025-05-23 8:26 a.m., The Natural Philosopher 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?

Use sudo to call the script.  First, drop a file into /etc/sudoers.d/
containing something like the following (untested):

www ALL = (root) NOPASSWD: /path/to/script

That should allow Apache running as www to call 'sudo /path/script' to
run 'script' as root with no password needed.  But at the same time, the
www user won't be able to run anything else as root (nor any other user).

Date Sujet#  Auteur
23 May 25 * Simple way for web to execute root shell script.48The Natural Philosopher
23 May 25 +* Re: Simple way for web to execute root shell script.4Pancho
23 May 25 i+* Re: Simple way for web to execute root shell script.2Lew Pitcher
23 May 25 ii`- Re: Simple way for web to execute root shell script.1The Natural Philosopher
23 May 25 i`- Re: Simple way for web to execute root shell script.1The Natural Philosopher
23 May 25 +* Re: Simple way for web to execute root shell script.7Lew Pitcher
23 May 25 i+* Re: Simple way for web to execute root shell script.2Lew Pitcher
23 May 25 ii`- Re: Simple way for web to execute root shell script.1The Natural Philosopher
23 May 25 i`* Re: Simple way for web to execute root shell script.4The Natural Philosopher
23 May 25 i `* Re: Simple way for web to execute root shell script.3Marc Haber
23 May 25 i  +- Re: Simple way for web to execute root shell script.1The Natural Philosopher
24 May 25 i  `- Re: Simple way for web to execute root shell script.1Lawrence D'Oliveiro
23 May 25 +* Re: Simple way for web to execute root shell script.2John-Paul Stewart
23 May 25 i`- Re: Simple way for web to execute root shell script.1The Natural Philosopher
23 May 25 +- Re: Simple way for web to execute root shell script.1Eli the Bearded
23 May 25 +* Re: Simple way for web to execute root shell script.21Rich
23 May 25 i`* Re: Simple way for web to execute root shell script.20The Natural Philosopher
24 May 25 i +* Re: Simple way for web to execute root shell script.2Rich
24 May 25 i i`- Re: Simple way for web to execute root shell script.1The Natural Philosopher
24 May 25 i +- Re: Simple way for web to execute root shell script.1Theo
24 May 25 i +- Re: Simple way for web to execute root shell script.1Chris Elvidge
25 May 25 i `* Re: Simple way for web to execute root shell script.15Anssi Saari
25 May 25 i  `* Re: Simple way for web to execute root shell script.14The Natural Philosopher
25 May 25 i   +* Re: Simple way for web to execute root shell script.3Lawrence D'Oliveiro
29 May 25 i   i`* Re: Simple way for web to execute root shell script.2vallor
29 May 25 i   i `- Re: Simple way for web to execute root shell script.1The Natural Philosopher
26 May 25 i   `* Re: Simple way for web to execute root shell script.10Anssi Saari
26 May 25 i    +- Re: Simple way for web to execute root shell script.1The Natural Philosopher
27 May 25 i    `* Re: Simple way for web to execute root shell script.8druck
28 May 25 i     `* Re: Simple way for web to execute root shell script.7The Natural Philosopher
28 May 25 i      `* Re: Simple way for web to execute root shell script.6druck
29 May 25 i       +* Re: Simple way for web to execute root shell script.4Anssi Saari
29 May 25 i       i`* Re: Simple way for web to execute root shell script.3The Natural Philosopher
30 May 25 i       i `* Re: Simple way for web to execute root shell script.2Anssi Saari
30 May 25 i       i  `- Re: Simple way for web to execute root shell script.1The Natural Philosopher
29 May 25 i       `- Re: Simple way for web to execute root shell script.1The Natural Philosopher
23 May 25 +- Re: Simple way for web to execute root shell script.1druck
24 May 25 +- Re: Simple way for web to execute root shell script.1Lawrence D'Oliveiro
24 May 25 +* Re: Simple way for web to execute root shell script.6The Natural Philosopher
24 May 25 i+* Re: Simple way for web to execute root shell script.4Richard Kettlewell
24 May 25 ii+- Re: Simple way for web to execute root shell script.1The Natural Philosopher
24 May 25 ii`* Re: Simple way for web to execute root shell script.2Eli the Bearded
24 May 25 ii `- Re: Simple way for web to execute root shell script.1Richard Kettlewell
24 May 25 i`- Re: Simple way for web to execute root shell script.1Rich
24 May 25 +- Re: Simple way for web to execute root shell script.1Andrew Smallshaw
29 May 25 +* Re: Simple way for web to execute root shell script.2Michael Schwingen
29 May 25 i`- Re: Simple way for web to execute root shell script.1The Natural Philosopher
4 Jun 25 `- Re: Simple way for web to execute root shell script.1Chris Narkiewicz

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal