Path: news.eternal-september.org!eternal-september.org!feeder3.eternal-september.org!border-2.nntp.ord.giganews.com!nntp.giganews.com!Xl.tags.giganews.com!local-4.nntp.ord.giganews.com!news.giganews.com.POSTED!not-for-mail NNTP-Posting-Date: Tue, 27 May 2025 05:48:39 +0000 Subject: Re: Simple way for web to execute root shell script. Newsgroups: comp.os.linux.misc References: <100pphq$2taj$2@dont-email.me> <1012843$amga$1@solani.org> From: c186282 Date: Tue, 27 May 2025 01:48:34 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 MIME-Version: 1.0 In-Reply-To: <1012843$amga$1@solani.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Message-ID: Lines: 16 X-Usenet-Provider: http://www.giganews.com X-Trace: sv3-KYDXnWmo9OxxL3aejlxbwWnkIMF7S3rzzO+7IT0jOvkD3SOU8L3FBiSjIoko4GOLC0/U5jLtUnD9How!KZFMj/xqtF3IuVsYOeHwZ3lVAfSFbzfpnEO0yrOfCAKEfXaqoYkeqbiccoMfLn8O95IqK481hCwI X-Complaints-To: abuse@giganews.com X-DMCA-Notifications: http://www.giganews.com/info/dmca.html X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.40 On 5/26/25 1:24 PM, Dominik Ałaszewski wrote: > Dnia 23.05.2025 The Natural Philosopher napisał/a: >> I have a shell script that monitors hardware stuff - it needs to run as >> root and be called by Apache as user www. > > One can consider communicating via files. Apache writes a file > in a certain location (perhaps with the arguments for the script), > script run (as root) is then triggered via inotify mechanism (one can utilise i.e. incron), > the results are written to another file, readable by Apache. Done that - and it WORKS. A bit 'convoluted' true, but it's fairly secure.