Sujet : Re: Simple way for web to execute root shell script.
De : mh+usenetspam1118 (at) *nospam* zugschl.us (Marc Haber)
Groupes : comp.os.linux.misc comp.sys.raspberry-piDate : 23. May 2025, 16:24:23
Autres entêtes
Organisation : private site, see http://www.zugschlus.de/ for details
Message-ID : <100q3v7$inu3$1@news1.tnib.de>
References : 1 2 3
User-Agent : Forte Agent 6.00/32.1186
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¹.
Greetings
Marc
¹ I maintain sudo in Debian
-- ----------------------------------------------------------------------------Marc Haber | " Questions are the | Mailadresse im HeaderRhein-Neckar, DE | Beginning of Wisdom " | Nordisch by Nature | Lt. Worf, TNG "Rightful Heir" | Fon: *49 6224 1600402
| Date | Sujet | # | | Auteur |
| 3 Apr 26 | … | | | |
Haut de la page
Les messages affichés proviennent d'usenet.
NewsPortal