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

Liste des GroupesRevenir à col misc 
Sujet : Re: Simple way for web to execute root shell script.
De : tnp (at) *nospam* invalid.invalid (The Natural Philosopher)
Groupes : comp.os.linux.misc comp.sys.raspberry-pi
Date : 23. May 2025, 17:53:21
Autres entêtes
Organisation : A little, after lunch
Message-ID : <100q961$62mq$1@dont-email.me>
References : 1 2 3 4
User-Agent : Mozilla Thunderbird
On 23/05/2025 16:24, Marc Haber wrote:
The Natural Philosopher <tnp@invalid.invalid> wrote:
On 23/05/2025 15:08, Lew Pitcher wrote:
On Fri, 23 May 2025 13:26:34 +0100, 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.
>
As you probably already know, the system won't run shell scripts as setuid,
even if the setuid bit is set. So, the direct route is out.
>
>
    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?
>
My gut reaction would be to have the webserver use sudo(1) (with suitable
limitations set in the /etc/sudoers file) to run the script via a system(3)
call.
>
cant one execute it direct from apache?
 If it's a shell script then it won't run as root even if it is suid
root.
 I'd go the sudo way, but I'm not neutral about that¹.
 
I did in fact go that way...
After stumbling through the usual mess of 'it worked perfectly well before so let's change the way we do it' crap with apache2 versus 2.4..

Greetings
Marc
 ¹ I maintain sudo in Debian
--
“Puritanism: The haunting fear that someone, somewhere, may be happy.”
H.L. Mencken, A Mencken Chrestomathy

Date Sujet#  Auteur
23 May13:26 * Simple way for web to execute root shell script.34The Natural Philosopher
23 May13:51 +* Re: Simple way for web to execute root shell script.4Pancho
23 May15:47 i+* Re: Simple way for web to execute root shell script.2Lew Pitcher
23 May16:06 ii`- Re: Simple way for web to execute root shell script.1The Natural Philosopher
23 May16:00 i`- Re: Simple way for web to execute root shell script.1The Natural Philosopher
23 May15:08 +* Re: Simple way for web to execute root shell script.7Lew Pitcher
23 May15:23 i+* Re: Simple way for web to execute root shell script.2Lew Pitcher
23 May16:03 ii`- Re: Simple way for web to execute root shell script.1The Natural Philosopher
23 May16:02 i`* Re: Simple way for web to execute root shell script.4The Natural Philosopher
23 May16:24 i `* Re: Simple way for web to execute root shell script.3Marc Haber
23 May17:53 i  +- Re: Simple way for web to execute root shell script.1The Natural Philosopher
24 May01:37 i  `- Re: Simple way for web to execute root shell script.1Lawrence D'Oliveiro
23 May15:14 +* Re: Simple way for web to execute root shell script.2John-Paul Stewart
23 May16:05 i`- Re: Simple way for web to execute root shell script.1The Natural Philosopher
23 May17:46 +- Re: Simple way for web to execute root shell script.1Eli the Bearded
23 May19:44 +* Re: Simple way for web to execute root shell script.9Rich
23 May21:44 i`* Re: Simple way for web to execute root shell script.8The Natural Philosopher
24 May03:13 i +* Re: Simple way for web to execute root shell script.2Rich
24 May09:18 i i`- Re: Simple way for web to execute root shell script.1The Natural Philosopher
24 May08:27 i +- Re: Simple way for web to execute root shell script.1Theo
24 May13:28 i +- Re: Simple way for web to execute root shell script.1Chris Elvidge
25 May08:17 i `* Re: Simple way for web to execute root shell script.3Anssi Saari
25 May08:52 i  `* Re: Simple way for web to execute root shell script.2The Natural Philosopher
25 May10:42 i   `- Re: Simple way for web to execute root shell script.1Lawrence D'Oliveiro
23 May22:17 +- Re: Simple way for web to execute root shell script.1druck
24 May00:11 +- Re: Simple way for web to execute root shell script.1Lawrence D'Oliveiro
24 May09:20 +* Re: Simple way for web to execute root shell script.6The Natural Philosopher
24 May10:58 i+* Re: Simple way for web to execute root shell script.4Richard Kettlewell
24 May11:27 ii+- Re: Simple way for web to execute root shell script.1The Natural Philosopher
24 May18:55 ii`* Re: Simple way for web to execute root shell script.2Eli the Bearded
24 May19:24 ii `- Re: Simple way for web to execute root shell script.1Richard Kettlewell
24 May16:41 i`- Re: Simple way for web to execute root shell script.1Rich
24 May18:35 `* Re: Simple way for web to execute root shell script.2Andrew Smallshaw
24 May22:34  `- Re: Simple way for web to execute root shell script.1Fritz Wuehler

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal