Sujet : Re: Simple way for web to execute root shell script.
De : news (at) *nospam* druck.org.uk (druck)
Groupes : comp.os.linux.misc comp.sys.raspberry-piDate : 23. May 2025, 22:17:22
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <100qol3$8so3$1@dont-email.me>
References : 1
User-Agent : Mozilla Thunderbird
On 23/05/2025 13:26, 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.
It probably doesn't need to run as root, but rather the www (I suspect you mean www-data) user should be in the correct group to access the hardware.
I have various Pi's running Python flask http servers or use the nginx web server and uwsgi to run Python programs. They all run as the www-data user, and the have access to cameras, i2c and 1-wire temperature sensors (groups video, i2c and gpio), and also the disk group so they can write results to sqlite databases. Nothing runs as root.
---druck