Search code examples
ubuntuscriptingcompilationsuid

compile shell script so can use suid


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?


Solution

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