Re: [Hampshire] Running a script that needs to do a rooty th…

Top Page

Reply to this message
Author: Vic
Date:  
To: hampshire
Subject: Re: [Hampshire] Running a script that needs to do a rooty thing

> It would be daft to make www-data a sudoer and I'm not sure how I would do
> that anyway. Any ideas on how to achieve this, or alternatives?


Factor out the couple of bits that need root privilege, and put them in
their own scripts. Make those scripts executable only by the www-data
user, and then make them setuid.

Your main script can then run with reduced privilege, and call the setuid
ones as necessary.

Vic.