[Kc] Shell script to execute system command as another user

Brad brad at bradandkim.net
Mon May 3 11:52:13 CDT 2004


On Mon, 2004-05-03 at 10:21, Andrew Moore wrote:
> On Mon, May 03, 2004 at 09:25:40AM -0500, Brad wrote:
> > How can I set up a perl script that will be owned and executed by nobody
> > (executed through apache) that will then execute a shell command as the
> > user cyrus?
> 
> A popular method seems to be to use "sudo". You can give 'nobody'
> permissions to run a certain command as 'cyrus', perhaps without a
> password, in the /etc/sudoers file, I believe.
> 
> That seems to be better than making the shell script (or command) suid
> cyrus for some reasons.
> 
> Hope it helps.
> 
> -Andy

So you think this is a 'safer' alternative than suid?  I will check this
out.  I am going to look at the suid options also.  Thanks to John for
that advice as well.

Brad




More information about the kc mailing list