Linux.com

Run bash setuid/setgid

Posted by: Anonymous Coward on December 07, 2005 11:44 PM
From the <tt>bash</tt> manpage:
If the shell is started with the effective user (group) id not equal to the real user (group) id, and the -p option is not supplied, no startup files are read, shell functions are not inherited from the environment, the SHELLOPTS variable, if it appears in the environment, is ignored, and the effective user id is set to the real user id. If the -p option is supplied at invocation, the startup behavior is the same, but the effective user id is not reset.

Linux doesn't allow setuid shell scripts anyways, but the <tt>bash</tt> behavior (inherited from <tt>ksh</tt> I think) should be noted.

The better (but less fun) solution would be to make a script (chmod 700) and set up <tt>sudo</tt> so that the desired users can run that script.

#

Return to Custom scripting gives users a safe-du