Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 8 Aug 2001 20:59:00 -0400
From:      Brian T.Schellenberger <bts@babbleon.org>
To:        Mike Meyer <mwm@mired.org>, Eric Anderson <anderson@centtech.com>
Cc:        questions@FreeBSD.ORG
Subject:   Re: finding user of su
Message-ID:  <01080820590001.19642@i8k.babbleon.org>
In-Reply-To: <15217.48743.5521.681759@guru.mired.org>
References:  <15217.48743.5521.681759@guru.mired.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wednesday 08 August 2001 18:34, 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.

Indeed, the whole purpose of su is to make it impossible to tell.
Everybody ultimately descends from process 0, but it has to be possible to 
"start afresh" and that's what su does.

When you su you really become root (or whoever) . . . and if you "su -" then 
even the environment is reset.

You really shouldn't need to know . . . if people are su'ing so much that 
it's a problem, they are su'ing too much, and you should look into "sudo" or 
(my personal preference) "op" in order to avoid having to "su" all the time.


-- 
Brian T. Schellenberger . . . . . . .   bts@wnt.sas.com (work)
Brian, the man from Babble-On . . . .   bts@babbleon.org (personal)

--------------------> Free Dmitry Sklyarov! <-------------------------

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?01080820590001.19642>