[sudo-users] Passing the uid sudo was run by
pottmi at gmail.com
Wed Dec 6 23:54:51 EST 2006
On 12/6/06, Matthew Hannigan <mlh at zip.com.au> wrote:
> On Wed, Dec 06, 2006 at 03:28:16PM +1000, Paul Stepowski wrote:
> > Hi list,
> > I was wondering if it's possible for a script to check which user sudo
> was run as.
> environment variable SUDO_USER
SUDO_USER would be the username.
SUDO_UID is the user id (number)
echo "original uid=$SUDO_UID($SUDO_USER)"
> > paul at box$ sudo ./my_script
> > original uid=509(paul)
> > Is there any way for ./myscript to know the original uid of the user who
> > sudo?
> > If so, can this be done in such a way that the uid cannot be
> > by the user running "sudo ./myscript"?
> Yeah, but of course not if ./myscript is modifiable by that
> sudo-users mailing list <sudo-users at sudo.ws>
> For list information, options, or to unsubscribe, visit:
More information about the sudo-users