I'm just an aspiring PFY, but I would suggest setting the setuid bit on
another script which performs the actions that you want, and then calling
that script from the script which runs as root. This gives you the added
benefit of logging out of that user whent he script is done.
Things like logging out (and I would assume su, though I haven't tried it)
are very difficult in bash, but easy in csh (anybody know how to do it in
korn?). Power vs. ease of use. Now that I'm more comfortable with Unix, I'm
really tempted to switch to csh.
Just throwing out ideas.
On Thursday 20 February 2003 22:23, David Smith wrote:
> I'd like to be Borne Again in a script running as root. How can I change
> to a different user (su won't work) during execution, like setuid(int)
> does in C?
>
> --Dave
<snip>
____________________
BYU Unix Users Group
http://uug.byu.edu/
___________________________________________________________________
List Info: http://phantom.byu.edu/cgi-bin/mailman/listinfo/uug-list