Deutsch   English   Français   Italiano  
<100qvbb$a8a5$4@dont-email.me>

View for Bookmarking (what is this?)
Look up another Usenet article

Path: ...!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!eternal-september.org!.POSTED!not-for-mail
From: Lawrence D'Oliveiro <ldo@nz.invalid>
Newsgroups: comp.os.linux.misc,comp.sys.raspberry-pi
Subject: Re: Simple way for web to execute root shell script.
Date: Fri, 23 May 2025 23:11:39 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 14
Message-ID: <100qvbb$a8a5$4@dont-email.me>
References: <100pphq$2taj$2@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Sat, 24 May 2025 01:11:39 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="6738d3dcc766298d22d18dc5830f0a7e";
	logging-data="336197"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX1+0POmNw1B5rqkNISVfIDfu"
User-Agent: Pan/0.162 (Pokrosvk)
Cancel-Lock: sha1:co7d3HNeWxKFQ+rKq8ENvVJEwOk=
Bytes: 1639

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.

You could have it running all the time and accepting requests to do things 
via a socket interface that you can connect to from a web-based frontend.

Alternatively, it can be running its own mini HTTP server, either directly 
exposed on a public port or accessed via a server-side proxy (what they 
insist on calling a “reverse proxy”) from Apache/Nginx.

Either way, this would likely be awkward to implement as a shell script. I 
would recommend using Python instead.