Date: Wed, 8 Aug 2001 20:30:55 -0500 From: Mike Meyer <mwm@mired.org> To: David Scheidt <dscheidt@enteract.com> Cc: Eric Anderson <anderson@centtech.com>, <questions@freebsd.org> Subject: Re: finding user of su Message-ID: <15217.59343.135209.179513@guru.mired.org> In-Reply-To: <Pine.BSF.4.32L2.0108081959200.52189-100000@shell-2.enteract.com> References: <15217.48743.5521.681759@guru.mired.org> <Pine.BSF.4.32L2.0108081959200.52189-100000@shell-2.enteract.com>
next in thread | previous in thread | raw e-mail | index | archive | help
David Scheidt <dscheidt@enteract.com> types: > On Wed, 8 Aug 2001, Mike Meyer wrote: > > :Eric Anderson <anderson@centtech.com> types: > :> Is there a tool (or how would I write one) that can tell me the original > :> user after an su? Basically, if I su to root, how can I tell who I su'd > :> from? > : > :There are a number of ways, but none are 100% reliable. You can check > :the USER environment variable, which the su command normaly doesn't > :change. You can suspend or exit the shell, and see what user you wind > :up as. There are probably other ways as well. > : > > su-2.03# whoami > root > su-2.03# who am i > david ttyp4 Aug 2 19:24 (:0.0) I get different results: guru# whoami root guru# who am i root ttyp0 Aug 8 20:28 guru# <mike -- Mike Meyer <mwm@mired.org> http://www.mired.org/home/mwm/ Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?15217.59343.135209.179513>