Re: [lug-nuts] running a script as another user

From: Mike Machado (mike@innercite.com)
Date: Mon Jan 17 2000 - 11:41:47 PST


Brian Lavender wrote:
>
> Try this
>
> chmod u+s ./scriptname
>

I beleive setuid has no affect on scipts, only binary programs. You
probably want to do

su someuser -c 'command -x -y -z'

ex: su nobody -c '/usr/local/games/quake/qwsv +gamedir fortress'

which will su to user nobody then run qwsv. I take it you do not want to
start your quake server as root :)

> and have it owned by whichever owner you want it to run as. Anyone
> corrections to this?
>
> brian
>
> On Mon, Jan 17, 2000 at 11:22:17AM -0800, Scott Tyson wrote:
> > I would like to put some scripts in my rc.local file but I do not want
> > them to execute as root. Is there a way to specify what user the script
> > executes as? The scripts are shell/perl.
>
> --
> Brian Lavender
> http://www.brie.com/brian/
> ****************************************************************************
> * To UNSUBSCRIBE from the list, send a message with "unsubscribe lug-nuts"
> * in the message body to majordomo@saclug.org. Please direct other
> * questions, comments, or problems to lug-nuts-owner@saclug.org.

-- 
Mike Machado
mike@innercite.com
InnerCite
Network Specialist
****************************************************************************
* To UNSUBSCRIBE from the list, send a message with "unsubscribe lug-nuts"
* in the message body to majordomo@saclug.org. Please direct other
* questions, comments, or problems to lug-nuts-owner@saclug.org.



This archive was generated by hypermail 2b29 : Fri Feb 25 2000 - 14:29:10 PST