[ale] Running a script as root

gene gene at mmc-inc.com
Fri Jan 11 09:05:28 EST 2002


I think you could accomplish this by making the script setuid to root. 
This allows the script to execute as root.  Without looking it up (man
chmod), I think you use a 4 to set that:

e.g.

chmod 4760 script.sh

Of course, the 760 can be whatever your current permissions are on the
file, or whatever you wish/need.

gene

On Fri, 2002-01-11 at 08:56, Gary MacKay wrote:
> I have some scripts that trigger off of specific email subjects. I have
> one that needs to be root when it runs due to some file movement, etc. I
> have gotten around that so far by giving sudo access to a command or two
> for that user. Instead of generically giving a user access to 'rm' and
> such, is there a way to make the whole script run as root? Then it
> wouldn't matter what commands are in it, it would run. Also I could
> remove the sudo access to that user. :)
> 
> - Gary
> 
> ---
> This message has been sent through the ALE general discussion list.
> See http://www.ale.org/mailing-lists.shtml for more info. Problems should be 
> sent to listmaster at ale dot org.
> 



---
This message has been sent through the ALE general discussion list.
See http://www.ale.org/mailing-lists.shtml for more info. Problems should be 
sent to listmaster at ale dot org.






More information about the Ale mailing list