SU and Back

Hi All,

I know this might be a strange question, but here goes.

Is there a way in a script file to go from ‘user’ to ‘super user’
preform some operations as a SU and return to user?

John

You can fake this by having those operations performed by an executable,
setting the owner of the executable to root (or other super user) and then
doing a “chmod +s the_executable” so that the file runs as the superuser no
matter who starts it.
Personally I’ve done “chmod +s /bin/shutdown /bin/tape” so that any user can
shutdown or run the tape on those systems.
Be careful - this is dangerous.
Its a bit safer to do a chown to a specific fake account, and give ownership
of the utility and device to that user. i.e. “chown tape_user:util_group
/bin/tape /dev/tp0; chmod +s /bin/tape”
and thus all tape operations are as if “tape_user” did them.

-Paul

John Parsons <parsonsj@esi.com> wrote in message
news:39D49825.ED273D6E@esi.com

Hi All,

I know this might be a strange question, but here goes.

Is there a way in a script file to go from ‘user’ to ‘super user’
preform some operations as a SU and return to user?

John