Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 8 Aug 2001 17:34:15 -0500
From:      Mike Meyer <mwm@mired.org>
To:        Eric Anderson <anderson@centtech.com>
Cc:        questions@freebsd.org
Subject:   Re: finding user of su
Message-ID:  <15217.48743.5521.681759@guru.mired.org>
In-Reply-To: <66038193@toto.iv>

next in thread | previous in thread | raw e-mail | index | archive | help
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.

	<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.48743.5521.681759>