views:

247

answers:

2

I need to suid a script so that it can be executed by users with less permissions. Since you can't suid a script and can only suid an executable I wanted to use the generic script compiler "shc" to create an executable and then set that executable's suid bit. Only problem is that on ubuntu jaunty I can't find shc or when I do apt-get install shc, it's comes back as not found. Is there an alternative to using shc (except writing my own C program) or is it included into a repo that I could add, so that apt-get would find it?

+1  A: 

Inside the script use sudo to execute any administrative commands.

mcandre
will that not prompt the user for a password, I just want them to be able to execute ./somescript and be done with it, I don't want them to have to know the password of the user account that the script runs as.
john ryan
+1  A: 

I had this same question over on serverfault - you can edit the sudoers file to grant permission to run a shell script.

Tom Ritter